Skip to content

Instantly share code, notes, and snippets.

@blooalien
Forked from ducin/knotify.py
Created July 22, 2017 07:05
Show Gist options
  • Save blooalien/b9a99939bba380873684da276e550354 to your computer and use it in GitHub Desktop.
Save blooalien/b9a99939bba380873684da276e550354 to your computer and use it in GitHub Desktop.
KNotify (KDE DBUS notifications); use it with: ./knotify.py "header" "content" (credited to http://www.documentroot.net/en/linux/knotify-python)
#!/usr/bin/python
import sys, dbus
knotify = dbus.SessionBus().get_object("org.kde.knotify", "/Notify")
try: title, text = sys.argv[1:3]
except: print 'Usage: knotify.py title text'; sys.exit(1)
knotify.event("warning", "kde", [], title, text, [], [], 0, 0, dbus_interface="org.kde.KNotify")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment