Last active
August 4, 2023 19:17
-
-
Save furkanmustafa/3fe97863a2f5f6b0bb0c to your computer and use it in GitHub Desktop.
A simple script to play random mp3s in a folder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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