mirror of https://github.com/sgoudham/dotfiles.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
572 B
Bash
32 lines
572 B
Bash
#!/usr/bin/env bash
|
|
# study stream aliases
|
|
# Requires https://github.com/caarlos0/timer to be installed.
|
|
|
|
declare -A pomo_options
|
|
pomo_options["work"]="25"
|
|
pomo_options["break"]="5"
|
|
|
|
exit_if_ctrl_c() {
|
|
exit
|
|
}
|
|
|
|
trap exit_if_ctrl_c SIGINT
|
|
|
|
pomodoro() {
|
|
if [ -n "$1" -a -n "${pomo_options["$1"]}" ]; then
|
|
val=$1
|
|
echo $val | lolcat
|
|
timer ${pomo_options["$val"]}m
|
|
notify-send "'$val' session done"
|
|
fi
|
|
}
|
|
|
|
cycle_work_break() {
|
|
for i in $(seq $1); do
|
|
pomodoro 'work'
|
|
pomodoro 'break'
|
|
done
|
|
}
|
|
|
|
cycle_work_break $1
|