Created
July 17, 2020 15:33
-
-
Save diegogangl/02691c97f2747af2c86919acbda59d69 to your computer and use it in GitHub Desktop.
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
bus = Gio.bus_get_sync(Gio.BusType.SYSTEM) | |
bus.signal_subscribe(None, 'org.freedesktop.login1.Manager', | |
'PrepareForSleep', None, None, | |
Gio.DBusSignalFlags.NONE, | |
on_prepare_for_sleep) | |
def on_prepare_for_sleep(connection, sender_name, object_path, | |
interface_name, signal_name, parameters, | |
*user_data): | |
"""Handle dbus prepare for sleep signal.""" | |
print('Called') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment