Last active
October 9, 2020 09:01
-
-
Save ddneat/8190495 to your computer and use it in GitHub Desktop.
listen to random music with afplay
This file contains 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
brew install gshuf |
This file contains 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
find *.mp3 | gshuf -n 1 | tr '\0\n' '\n\0' | xargs -0 afplay |
if necessary just install the missing gshuf package on your mac
very useful!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
gshuf is an alternative to sort -R and identical to the unix common shuf command. each gshuf command comes with g prefix. gshuf is needed because osx is shipped without sort -R and the shuf command.