1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
#!/usr/bin/python3
from gi.repository import Notify
import time
def on_click(notification, action):
pass
Notify.init("test-notification")
notification = Notify.Notification.new("Test - no buttons", "This is a test of a notification", "gtk-dialog-info")
notification.show()
time.sleep(6)
notification = Notify.Notification.new("Test - with buttons", "This is a test of a notification with buttons. It shouldn't fade", "gtk-dialog-info")
notification.add_action("Foo", "Okay!", on_click, None)
notification.show()
quit()
|