-
-
Save anonymous/cbc5b0e290843dc2c110 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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