Skip to content

Instantly share code, notes, and snippets.

@srih4ri
Created March 7, 2014 04:06
Show Gist options
  • Save srih4ri/9405064 to your computer and use it in GitHub Desktop.
Save srih4ri/9405064 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
file = "/home/srih4ri/code/rm_current_clem/to_delete.txt"
require "dbus"
sesbus = DBus.session_bus
clem_service = sesbus["org.mpris.clementine"]
clem_object = clem_service.object "/Player"
clem_object.introspect
clem_iface = clem_object['org.freedesktop.MediaPlayer']
meta = clem_iface.GetMetadata
file_loc = meta[0]['location'].split('file://').last
File.open(file,'a'){ |f| f.puts file_loc }
clem_iface.Next
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment