aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpux <pux@pux.dom>2020-04-03 00:39:22 +0200
committerpux <pux@pux.dom>2020-04-03 00:39:22 +0200
commitbf286de1db011e040694be46c73c7e914e1b4a32 (patch)
treeab49c68cc6e118700b52327af95c22535010d061
parentca02d45a9b078aa1d385eed3721e215d41278048 (diff)
downloadtimebomb-bf286de1db011e040694be46c73c7e914e1b4a32.tar.gz
timebomb-bf286de1db011e040694be46c73c7e914e1b4a32.tar.bz2
timebomb-bf286de1db011e040694be46c73c7e914e1b4a32.zip
add notify-send msg
-rw-r--r--timebomb.py11
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)
in each repos: see "about"-tab (if existing) for more details / README.
mailto contact at omeckman dot net
all timestamps in UTC (German winter time: UTC+01:00, summer time: UTC+02:00)
dark theme is a modded version of: https://gist.github.com/Yoplitein/f4b671a2ec70c9e743fa