You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

24 lines
534 B

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