My build of nnn with minor changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

33 lines
821 B

  1. #!/usr/bin/env sh
  2. # Description: Play random music from current directory. Identifies MP3, FLAC, WEBM, WMA.
  3. # You may want to set GUIPLAYER.
  4. #
  5. # Shell: POSIX compliant
  6. # Author: Arun Prakash Jana
  7. #GUIPLAYER=smplayer
  8. if [ ! -z "$GUIPLAYER" ]; then
  9. PLAYER="$GUIPLAYER"
  10. find . -type f \( -iname "*.mp3" -o -iname "*.flac" -o -iname "*.webm" -o -iname "*.wma" \) | sort -R | head -n 100 | xargs -d "\n" "$PLAYER" > /dev/null 2>&1 &
  11. # detach the player
  12. disown
  13. else
  14. # exit MOC server
  15. mocp -x
  16. # start MOC server
  17. mocp -S
  18. # clear MOC playlist
  19. mocp -c
  20. # add up to 100 random audio files
  21. find . -type f \( -iname "*.mp3" -o -iname "*.flac" -o -iname "*.webm" -o -iname "*.wma" \) | sort -R | head -n 100 | xargs -d "\n" mocp -a
  22. # start playing
  23. mocp -p
  24. fi