Skip to content

Instantly share code, notes, and snippets.

@jameswpm
Last active December 27, 2023 15:53
Show Gist options
  • Star 26 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save jameswpm/2833c89b18fc3f571985779cbee0a2b8 to your computer and use it in GitHub Desktop.
Save jameswpm/2833c89b18fc3f571985779cbee0a2b8 to your computer and use it in GitHub Desktop.
Minimalistic Pomodoro Timer
#!/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
@marc31
Copy link

marc31 commented May 22, 2019

Hi, thank you for this script.
I want to use it maybe modify it a little bit.
What is the license for that script.

@jameswpm
Copy link
Author

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" ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment