diff options
author | pux <pux@pux.dom> | 2020-04-03 00:39:22 +0200 |
---|---|---|
committer | pux <pux@pux.dom> | 2020-04-03 00:39:22 +0200 |
commit | bf286de1db011e040694be46c73c7e914e1b4a32 (patch) | |
tree | ab49c68cc6e118700b52327af95c22535010d061 | |
parent | ca02d45a9b078aa1d385eed3721e215d41278048 (diff) | |
download | timebomb-bf286de1db011e040694be46c73c7e914e1b4a32.tar.gz timebomb-bf286de1db011e040694be46c73c7e914e1b4a32.tar.bz2 timebomb-bf286de1db011e040694be46c73c7e914e1b4a32.zip |
add notify-send msg
-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) |