Last active
July 8, 2024 10:53
-
-
Save sandorex/c5f585992f0b087c94ff4942e8771df5 to your computer and use it in GitHub Desktop.
Minimal example to subscribe to settings change in xdg-.desktop-portal
This file contains hidden or 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/env python3 | |
from dasbus.connection import SessionMessageBus, SystemMessageBus | |
from dasbus.loop import EventLoop | |
bus = SessionMessageBus() | |
loop = EventLoop() | |
proxy = bus.get_proxy( | |
"org.freedesktop.portal.Desktop", # service | |
"/org/freedesktop/portal/desktop", # obj path | |
"org.freedesktop.portal.Settings", # interface | |
) | |
def callback(*args): | |
print("The notification: ", *args) | |
proxy.SettingChanged.connect(callback) | |
loop.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment