-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpomodoro.sh
executable file
·56 lines (48 loc) · 1.33 KB
/
pomodoro.sh
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
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
# Provided minutes as an argument for a countdown.
# Pull the library that gives ASCI art, provided a 1. Folder 2. Chance of trigger
source ./get_random_file_from_folder.sh
gallery="./asci_art/"
rcheck_file="./reality_check"
function resetTimer {
# If there is no input parameters, assume normal Pomodoro time.
if [ $# == 0 ]
then
limit=25
else
limit=$1
fi
restTimer=5
}
while true
do
resetTimer;
# Count and report every minute.
while [ $limit -gt 0 ]
do
echo "Minutes remaining $limit"
limit=$(( $limit - 1 ))
# Maybe outputs the reward; the second parameter is the gauntlet difficulty
rewardRNG "$gallery" "6"
if $rollSuccess; then
# Every time there's an award, also check if a reality check happens, with a separate gauntlet
rcheckRNG "$rcheck_file" "6"
fi
sleep 60
done
# Once time has passed, notify to start break
osascript -e 'display notification "Break" with title "Your friendly tomato overlord"'
echo "Time's up! Walking away?"
read;
# Count minutes, resty style
while [ $restTimer -gt 0 ]
do
echo "\~.~/ \~.~/ \~.~/"
restTimer=$(( $restTimer - 1 ))
sleep 60
done
# Once back to work time, notify
osascript -e 'display notification "Back" with title "Your friendly tomato overlord"'
echo "Back. Press any key to restart timer."
read;
done