Last active
December 27, 2023 15:53
-
-
Save jameswpm/2833c89b18fc3f571985779cbee0a2b8 to your computer and use it in GitHub Desktop.
Minimalistic Pomodoro Timer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Minimalistic_Pomodoro_Timer | |
# | |
# Based on the SU answer found here: https://superuser.com/questions/224265/pomodoro-timer-for-linux/669811#669811 | |
# | |
# Tested in Ubuntu 16.04 and Arch | |
pomodorotime () { | |
notify-send "Time to Work" "Focus" -u normal -a 'Pomodoro' -i $HOME/Documentos/icon.png | |
paplay /usr/share/sounds/freedesktop/stereo/window-attention.oga | |
} | |
shortbreaktime () { | |
notify-send "Short Break Time" -u critical -a 'Pomodoro' -i $HOME/Documentos/icon.png | |
paplay /usr/share/sounds/freedesktop/stereo/complete.oga | |
# uncomment line below to lock your screen during the short break (needs to install xtrlock for your distribution) | |
# sleep 5 && xtrlock -b & sleep 250 && pkill xtrlock | |
} | |
longbreaktime () { | |
notify-send "Long Break Time" "Take a Rest" -u critical -a 'Pomodoro' -i $HOME/Documentos/icon.png | |
paplay /usr/share/sounds/freedesktop/stereo/complete.oga | |
} | |
case "$1" in | |
'start') | |
echo "Starting Pomodoro" | |
counter=0 | |
while true; do | |
now=`date +"%H:%M"` | |
pomodorotime | |
counter=$((counter+1)) | |
echo "Pomodoro number: $counter started at: $now" | |
sleep 1500 && shortbreaktime | |
sleep 300 && pomodorotime | |
now=`date +"%H:%M"` | |
counter=$((counter+1)) | |
echo "Pomodoro number: $counter started at: $now" | |
sleep 1500 && shortbreaktime | |
sleep 300 && pomodorotime | |
now=`date +"%H:%M"` | |
counter=$((counter+1)) | |
echo "Pomodoro number: $counter started at: $now" | |
sleep 1500 && shortbreaktime | |
sleep 300 && pomodorotime | |
now=`date +"%H:%M"` | |
counter=$((counter+1)) | |
echo "Pomodoro number: $counter started at: $now" | |
sleep 1500 && longbreaktime | |
echo "Long break time" | |
sleep 900 | |
done | |
;; | |
'pomo') | |
pomodorotime | |
sleep 1500 && shortbreaktime | |
;; | |
'sb') | |
sleep 300 && pomodorotime | |
;; | |
'lb') | |
sleep 900 && pomodorotime | |
;; | |
*) | |
echo | |
echo "Usage: $0 { start | pomo | sb | lb }" | |
echo | |
exit 1 | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey, @marc31
I didn't include any license for it because it's just a toy project, so "Do What the Fuck You Want To" ;-)