Created
April 14, 2021 03:55
-
-
Save moonexpr/680c5aa580e772275dcdff4f2709a955 to your computer and use it in GitHub Desktop.
Quick demo which pops a simple notification on the screen using DBus.
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/python3 | |
| from pydbus import SessionBus | |
| bus = SessionBus() | |
| # Create an object that will proxy for a particular remote object. | |
| remote_object = bus.get( | |
| 'org.gnome.Shell.Notifications', # Bus name | |
| '/org/freedesktop/Notifications' # Object path | |
| ) | |
| remote_object.Notify( | |
| '', # App name | |
| 0, # Replace id | |
| 'im.received', # Icon | |
| 'Python script', # Summary | |
| # Body | |
| 'This is a message from Python land!', | |
| [], | |
| [], | |
| 0 | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment