Skip to content

Instantly share code, notes, and snippets.

@ducin
Created August 4, 2013 21:53
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ducin/6152106 to your computer and use it in GitHub Desktop.
Save ducin/6152106 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