Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. import dbus
  2. import json
  3. bus = dbus.SessionBus()
  4.  
  5. # Create an object that will proxy for a particular remote object.
  6. remote_object = bus.get_object("org.mpris.MediaPlayer2.GnomeMusic", # Connection name
  7.                                "/org/mpris/MediaPlayer2" # Object's path
  8.                               )
  9.  
  10. iface = dbus.Interface(remote_object, 'org.freedesktop.DBus.Properties')
  11. msg = (json.dumps(iface.Get("org.mpris.MediaPlayer2.Player", "Metadata"), indent=0))
  12. print msg
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement