aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--timebomb.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/timebomb.py b/timebomb.py
index c8679bb..695f11a 100644
--- a/timebomb.py
+++ b/timebomb.py
@@ -23,7 +23,13 @@ def message(m, s):
msg = 'ALARM, Timer ran ' + str(m) + 'm and ' + str(s) + ' s'
notify_msg = notify2.Notification('ALARM', msg)
- notify_msg.show()
+ try:
+ notify_msg.show()
+ except:
+ # ignore
+ # dbus.exceptions.DBusException: org.freedesktop.Notifications.Max
+ # NotificationsExceeded: Exceeded maximum number of notifications
+ pass
if screen_width <= 0:
screen_width = 1024
@@ -88,7 +94,11 @@ def sleep(m, s):
if pbar_len < 20:
pbar_len = 20
- progress = int(x/(time_sum_s-1) * pbar_len)
+ n = time_sum_s-1
+ if n == 0:
+ progress = pbar_len
+ else:
+ progress = int(x/n * pbar_len)
print(left, end='')
print('#' * progress + '_' * int(pbar_len-progress), end='')
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