My build of nnn with minor changes
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

35 lignes
928 B

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