Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Pomodoro Bash
#!/bin/bash
# Public domain license
# Not original author: Remigijus Jarmalavičius
#
# Usage:
# pomodoro "title for work"
filename="/home/remigijus/Kodas/smelio-deze/`date '+%Y-%m-%d'`.log"
while [ 1 ]
do
counter=0
limit=25
summary="Podoro session"
startmessage="Start $1!"
endmessage="Done with $1! New session has started, interrupt to rest a bit."
notify-send -u critical -i appointment -t 6000 "$summary" "$startmessage"
echo
while [ $counter != $limit ]; do
clear
echo "Working on $1"
echo
if [ -e "$filename" ]
then
echo "Today:"
echo
sort "$filename" | awk '{print $1}' | uniq -c;
fi
echo
echo "Progress:"
echo
echo -en "\t["
for i in $(seq 1 $counter)
do
echo -n "#"
done
for i in $(seq 1 $(($limit-$counter)))
do
echo -n " "
done
echo -n "] $counter/$limit"
echo
sleep 60
let "counter = $counter + 1"
done
if [ $counter = $limit ]; then
echo
notify-send -u critical -i appointment "$summary" "$endmessage"
beep
echo $1 $2 >> "$filename"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.