-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpomodoro.sh
More file actions
executable file
·43 lines (35 loc) · 804 Bytes
/
pomodoro.sh
File metadata and controls
executable file
·43 lines (35 loc) · 804 Bytes
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
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
# A simple Pomodoro method timer
time_between_short_breaks=15m
short_break=5m
number_of_short_breaks_before_long_break=4
long_break=15m
bell_file="/usr/share/sounds/freedesktop/stereo/complete.oga"
let counter=0
function play_sound() {
cmus-remote -u
sleep .5
mplayer -volume 0 -msglevel -1 $bell_file
mplayer -msglevel -1 $bell_file
sleep .5
cmus-remote -u
}
notify() {
echo -e "${1}\a"
notify-send "Pomodoro.sh" "${1}"
}
while true; do
notify "Do your work, for the love of God!"
sleep $time_between_short_breaks
let counter++
play_sound
if (($counter < $number_of_short_breaks_before_long_break)); then
notify "You shall take a short break."
sleep $short_break
else
notify "You shall take a long break."
sleep $long_break
let counter=0
fi
play_sound
done