Created
August 12, 2023 20:32
-
-
Save ckjoris/cf2b3a7ef729e629409db47d29009b04 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
#!/usr/bin/python3.10 | |
def toggle_guake_by_dbus(): | |
import dbus # pylint: disable=import-outside-toplevel | |
import time | |
try: | |
bus = dbus.SessionBus() | |
remote_object = bus.get_object( | |
"org.guake3.RemoteControl", "/org/guake3/RemoteControl" | |
) | |
visibility = remote_object.get_visibility() | |
if visibility == 0: | |
remote_object.show() | |
time.sleep(0.2) | |
remote_object.show() | |
else: | |
remote_object.hide() | |
except dbus.DBusException: | |
pass | |
if __name__ == "__main__": | |
toggle_guake_by_dbus() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment