Skip to content

Instantly share code, notes, and snippets.

@fijimunkii
Last active August 29, 2015 13:57
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 fijimunkii/9521310 to your computer and use it in GitHub Desktop.
Save fijimunkii/9521310 to your computer and use it in GitHub Desktop.
sh: pianobar config
function lyrics
{
sh ~/.config/pianobar/lyrics.sh
}
user = yo@gmail.com
password = w00t
event_command = /Users/fijimunkii/.config/pianobar/eventcommand.sh
autostart_station = 45088214493320625
#!/bin/bash
fold="$HOME/.config/pianobar"
ctlf="$fold/ctl"
nowplaying="$fold/lyrics.sh"
while read L; do
k="`echo "$L" | cut -d '=' -f 1`"
v="`echo "$L" | cut -d '=' -f 2`"
export "$k=$v"
done < <(grep -e '^\(title\|artist\|album\|stationName\|pRet\|pRetStr\|wRet\|wRetStr\|songDuration\|songPlayed\|rating\|songDuration\|songPlayed\|coverArt\|stationCount\|station[0-9]\+\)=' /dev/stdin)
case "$1" in
songstart)
echo -e "glyrc lyrics -a \"$artist\" -t \"$title\" -b \"$album\" -w /tmp/" > "$nowplaying"
/usr/local/bin/terminal-notifier -subtitle "Artist: $artist" -message "Album: $album" -title "$title"
;;
esac
glyrc lyrics -a "Phish" -t "Roses Are Free (Live 1998)" -b "Hampton Comes Alive 1998-11-21" -w /tmp/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment