Created
December 18, 2015 18:13
-
-
Save mrkgrandjean/c5f8ea18ef798668ccc3 to your computer and use it in GitHub Desktop.
A simple way to make your pianobar, send you mac OsX notifications. It puts the Cover Art as the app Icon, and clicking on the notification skips that song. All files are placed in ~/.config/pianobar/, you also need to run gem install terminal-notifier, and put a blank file called ctl in the ~/.config/pianobar/ folder
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
user = user@email.com | |
password = s3cr3t | |
fifo = ~/.config/pianobar/ctl | |
event_command = ~/.config/pianobar/notifier.rb |
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 ruby | |
trigger = ARGV.shift | |
if trigger == 'songstart' | |
# Get current song information | |
songinfo = {} | |
STDIN.each_line { |line| songinfo.store(*line.chomp.split('=', 2)) } | |
`terminal-notifier -title "Pianobar: Now Playing" -message "#{songinfo['title']}\nby #{songinfo['artist']}" -appIcon "#{songinfo['coverArt']}" -execute "echo 'n' > ~/.config/pianobar/ctl"` | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment