Skip to content

Instantly share code, notes, and snippets.

@SergKolo
Created June 30, 2016 01:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save SergKolo/4bc7856ddfbc1fb4ff56732e60dd19db to your computer and use it in GitHub Desktop.
Save SergKolo/4bc7856ddfbc1fb4ff56732e60dd19db to your computer and use it in GitHub Desktop.
import dbus
def get_dbus(OBJ,PATH,INTERFACE,METHOD):
# This basically works the same as
# dbus-send or qdbus. Just give it
# all the info, and it will spit out output
bus = dbus.SessionBus()
proxy = bus.get_object(OBJ,PATH)
method = proxy.get_dbus_method(METHOD,INTERFACE)
return method()
windows = get_dbus( 'org.ayatana.bamf' , '/org/ayatana/bamf/matcher' , 'org.ayatana.bamf.matcher','WindowPaths' )
for window in windows:
print get_dbus( 'org.ayatana.bamf', window, 'org.ayatana.bamf.view','Name' )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment