Skip to content

Instantly share code, notes, and snippets.

@moonexpr
Created April 14, 2021 03:55
Show Gist options
  • Select an option

  • Save moonexpr/680c5aa580e772275dcdff4f2709a955 to your computer and use it in GitHub Desktop.

Select an option

Save moonexpr/680c5aa580e772275dcdff4f2709a955 to your computer and use it in GitHub Desktop.
Quick demo which pops a simple notification on the screen using DBus.
#!/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