Skip to content

Instantly share code, notes, and snippets.

@dhjw
Last active May 19, 2024 05:35
Show Gist options
  • Save dhjw/ce8d9b83c963576f80c08d110c50b67d to your computer and use it in GitHub Desktop.
Save dhjw/ce8d9b83c963576f80c08d110c50b67d to your computer and use it in GitHub Desktop.
# pip install sdbus-notifications
from sdbus_block.notifications import FreedesktopNotifications
iface = FreedesktopNotifications() # default bus works, but could do `from sdbus import sd_bus_open_user` and pass sd_bus_open_user()
app_name = ''
replace_id = 0 # new
app_icon = ''
summary = 'title'
body = 'body'
hints = iface.create_hints(urgency=1)
actions = []
expire_time = 3000
nid = iface.notify(app_name, replace_id, app_icon, summary, body, actions, hints, expire_time)
# iface.close_notification(nid)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment