summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2023-10-10 19:08:13 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2023-10-10 19:08:13 +0200
commitee6e9c223b1b73c08801b415c17e12f93e504f2a (patch)
tree71c2f8e7c397b1e9f6cfe87c359e600bf8f0dbf9 /bin
parent34bb4516d35f0d9c65f028f8e2ea0cda079fdf02 (diff)
use a function for breaks
Diffstat (limited to 'bin')
-rwxr-xr-xbin/extra/pomo19
1 files changed, 13 insertions, 6 deletions
diff --git a/bin/extra/pomo b/bin/extra/pomo
index 27722a4..859dd12 100755
--- a/bin/extra/pomo
+++ b/bin/extra/pomo
@@ -1,10 +1,20 @@
#!/bin/sh
-notif() { notify-send -t 1000 "pomo" "$1"; sleep 1; }
+notif() { notify-send -t "${2:-1000}" "pomo" "$1"; sleep 1; }
for msg in "three" "two" "one"
do notif "$msg"
done
+# $1: time in seconds
+# $2: msg for notification
+ring_ring()
+{
+ time="$(($1*1000*60))"
+ date '+%R B'
+ notif "$time" "$2"
+ sleep "$time"s
+}
+
i="${1-0}"
while true
@@ -12,15 +22,12 @@ do
notif "<b>START</b>"
date '+%R S'
sleep 20m
- date '+%R B'
if [ "$i" -eq 3 ]
then
- notify-send -u critical -t 1200000 "pomodoro" "GIGA BREAK TIME"
- sleep 20m
i=0
+ ring_ring 20 "GIGA BREAK TIME"
else
- notify-send -u critical -t 300000 "pomodoro" "BREAK TIME"
- sleep 5m
+ ring_ring 5 "BREAK TIME"
i=$((i+1))
fi
done