Created
June 29, 2012 15:37
-
-
Save zachpendleton/3018666 to your computer and use it in GitHub Desktop.
Save and format the current Pianobar song for display in tmux.
This file contains hidden or 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 | |
| # coding: utf-8 | |
| event = ARGV[0] | |
| if event == 'songstart' | |
| d = Hash.new | |
| STDIN.each_line { |line| d.store(*line.chomp.split('=', 2)) } | |
| File.open('/path/to/home/.config/pianobar/current-song.txt', 'w') do |f| | |
| f.write("#[bg=colour39,fg=colour8]♫ #{d['title']} - #{d['artist']} @ #{d['stationName']} #[fg=default,bg=default]") | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment