π π π [Music] π π π
git clone git@github.com:thinkocapo/bash-party-scripting.gitcd bash-party-scriptingcp your_song.mp3 ./songsor use the 5-second audio file that's already there
You must pass a word (e.g. your name). It's shown in big ASCII letters. Without it the script just prints the usage message and exits β no music.
Run it from inside the repo folder, since songs are loaded from ./songs.
# plays first song in the songs directory, flashing "WILLIAM"
./bashparty.sh william
# adds color
./bashparty.sh william --color
# plays random song from ./songs
./bashparty.sh william --random
# plays 3rd song from ./songs [0,1,2]
./bashparty.sh william --index 2
# flags can go before or after the word, and can be combined
./bashparty.sh --color --random williamPress Ctrl+C to stop.
No extra installs needed: if figlet is installed (brew install figlet) it's used for the ASCII art, otherwise a built-in block font is used.
When I was developing this the song got stuck running once.
ps aux | grep '<part_of_song_mp3_name>'
kill <pid>Debugging a script
set -x
...
set +x
Mac comes with afplay for linux you'll need something different.
