Skip to content

Instantly share code, notes, and snippets.

@shmup
Last active January 6, 2024 00:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shmup/7de83875a3208cb5a7018838bb331a5b to your computer and use it in GitHub Desktop.
Save shmup/7de83875a3208cb5a7018838bb331a5b to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
player="cvlc --loop"
track="https://dev.host/~shmup/tmp/Melancholia_I.mp3"
aquarium="http://asciiquarium.live"
reset() {
tput cnorm; stty echo; tput sgr0; clear
}
clean() {
kill $audio $aquarium > /dev/null 2>&1
reset
exit
}
trap clean SIGINT
curl -s $track | $player - &> /dev/null &
audio=$!
curl -s "$aquarium?cols=$(tput cols)&rows=$(tput lines)" &
aquarium=$!
wait $aquarium
clean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment