Skip to content

Instantly share code, notes, and snippets.

@ReekenX
Created March 18, 2014 06:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ReekenX/9614738 to your computer and use it in GitHub Desktop.
Save ReekenX/9614738 to your computer and use it in GitHub Desktop.
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