-
-
Save dgalling/304d46524f80239ced60 to your computer and use it in GitHub Desktop.
iTunes stopped working again. I wrote a simple music queue/player.
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
#!/usr/bin/env sh | |
TIMEOUT=0 | |
while true; do | |
AUDIO_FILE=$(redis-cli BLPOP "$MUSIC_QUEUE" $TIMEOUT | grep --max-count=1 '^/') | |
afplay "$AUDIO_FILE" | |
done | |
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
#!/usr/bin/env sh | |
set -e | |
MUSIC_DIR="/Volumes/Store/iTunes Media/Music" | |
pushd "$MUSIC_DIR" | |
AUDIO_FILE=$(find . -type f | selecta) | |
redis-cli RPUSH "$MUSIC_QUEUE" "$(realpath "$MUSIC_DIR/$AUDIO_FILE")" | |
popd | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment