Skip to content

Instantly share code, notes, and snippets.

@furkanmustafa
Last active August 4, 2023 19:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save furkanmustafa/3fe97863a2f5f6b0bb0c to your computer and use it in GitHub Desktop.
Save furkanmustafa/3fe97863a2f5f6b0bb0c to your computer and use it in GitHub Desktop.
A simple script to play random mp3s in a folder
#!/bin/bash -e
PLAYER="mpv -vo null"
#PLAYER="mpg321"
MUSIC=$(find . -regextype posix-extended -iregex '.*(m4a|mp3|mp4|aac)$' | sort -R)
IFS=$'\n'
for file in $MUSIC
do
IFS=$' '
$PLAYER "$file"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment