diff options
-rw-r--r-- | timebomb.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/timebomb.py b/timebomb.py index bd9e594..c62eedc 100644 --- a/timebomb.py +++ b/timebomb.py @@ -10,6 +10,7 @@ from tkinter import Canvas import argparse import time import shutil +import notify2 root = Tk() @@ -17,6 +18,11 @@ def message(m, s): screen_width = root.winfo_screenwidth() screen_height = root.winfo_screenheight() + msg = 'ALARM, Timer ran ' + str(m) + 'm and ' + str(s) + ' s' + + notify_msg = notify2.Notification('ALARM', msg) + notify_msg.show() + if screen_width <= 0: screen_width = 1024 if screen_height <= 0: @@ -25,8 +31,7 @@ def message(m, s): c = Canvas(root, bg = "darkred", \ width = screen_width, height = screen_height) c.pack() - messagebox.showwarning('ALARM', 'Timer ran ' + str(m) + ' m and ' \ - + str(s) + ' s') + messagebox.showwarning(msg) #root.mainloop() def main(): @@ -56,6 +61,8 @@ def main(): time_m = abs(args.m[0]) if args.s or args.m: + + notify2.init('timebomb') sleep(m=time_m, s=time_s) message(m=time_m, s=time_s) |