Skip to content

Instantly share code, notes, and snippets.

/main.py Secret
Created Aug 10, 2014

Embed
What would you like to do?
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
You can’t perform that action at this time.