Skip to content

Instantly share code, notes, and snippets.

/main.py Secret

Created August 10, 2014 03:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/cbc5b0e290843dc2c110 to your computer and use it in GitHub Desktop.
Save anonymous/cbc5b0e290843dc2c110 to your computer and use it in GitHub Desktop.
import dbus
BUS_NAME = 'org.freedesktop.Notifications'
OBJ_PATH = '/org/freedesktop/Notifications'
IFACE_NAME = 'org.freedesktop.Notifications'
bus = dbus.SessionBus()
notify_obj = bus.get_object(BUS_NAME,OBJ_PATH)
notifications = dbus.Interface(notify_obj,IFACE_NAME)
import time
id = notifications.Notify("Software Update", 0, "", "Installing Turtle Art", "SUMMARY NOT SHOWN", [], {'x-sugar-icon-name': 'module-updater', 'x-sugar-progress-bar': True, 'x-sugar-progress-pulse': True}, -1)
time.sleep(5)
for i in range(100):
id = notifications.Notify("Software Update", id, "", "Installing Turtle Art", "SUMMARY NOT SHOWN", [], {'x-sugar-icon-name': 'module-updater', 'x-sugar-progress-bar': True, 'x-sugar-progress-fraction': i/100.0, 'x-sugar-progress-text': True, 'urgency': 0}, -1)
time.sleep(0.1)
notifications.Notify("Software Update", id, "", "Installed Turtle Art", "Restart Turtle Art to use the latest version", [], {'x-sugar-icon-name': 'module-updater', 'urgency': 0}, -1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment