Skip to content

Instantly share code, notes, and snippets.

@konklone
Created November 13, 2009 19:51
Show Gist options
  • Save konklone/234102 to your computer and use it in GitHub Desktop.
Save konklone/234102 to your computer and use it in GitHub Desktop.
# This is now n actual repo, here:
# http://github.com/klondike/muine-osd
#!/usr/bin/env ruby
require 'yaml'
def d(string); string.gsub /[\'\"]/, ''; end
def load_song(details)
song = {}
details.split(/[\n\r]+/).each do |line|
pieces = line.split ':'
key = pieces.shift.strip
value = pieces.join ':'
song[key] = value
end
song
end
info = load_song `muine-shell --current-song`
icon = '/usr/share/icons/gnome/scalable/mimetypes/gnome-mime-audio.svg'
`notify-send --icon=#{icon} \"#{d info['artist']}\" \"#{d info['title']}\"`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment