File: test-notification

package info (click to toggle)
cinnamon 6.4.13-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,300 kB
  • sloc: javascript: 54,298; ansic: 51,499; python: 21,971; xml: 2,803; sh: 96; makefile: 27; perl: 13
file content (23 lines) | stat: -rwxr-xr-x 534 bytes parent folder | download | duplicates (5)
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()