-
-
Save teward/4ffa18aa5a0dae802cd79a07e1dcc254 to your computer and use it in GitHub Desktop.
SerglyDBUS
This file contains 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
import dbus | |
SESSION_BUS = dbus.SessionBus() | |
# This stuff below will work ok on its own. | |
# ayatana = session_bus.get_object('org.ayatana.bamf', '/org/ayatana/bamf/matcher') | |
# windows = ayatana.WindowPaths(dbus_interface='org.ayatana.bamf.matcher') | |
def get_dbus_object(obj, path): | |
# This returns a DBUS object for the given object and paths, specified as string. | |
return SESSION_BUS.get_object(obj, path) | |
def get_dbus_windowpaths(obj, interface): | |
return obj.WindowPaths(dbus_interface=interface) | |
if __name__ == "__main__": | |
dbus = get_dbus_object('org.ayatana.bamf', '/org/ayatana/bamf/matcher') | |
windows = get_dbus_windowpaths(dbus, 'org.ayatana.bamf.matcher') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment