summaryrefslogtreecommitdiff
path: root/bin/extra/pomo
blob: 859dd12311797b8824ec49022e11441bcc77a7e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh
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

do 
	notif "<b>START</b>"
	date '+%R S'
	sleep 20m
	if [ "$i" -eq 3 ]
	then
		i=0
		ring_ring 20 "GIGA BREAK TIME"
	else
		ring_ring 5 "BREAK TIME"
		i=$((i+1))
	fi
done