Created
March 18, 2014 06:43
-
-
Save ReekenX/9614738 to your computer and use it in GitHub Desktop.
Pomodoro Bash
This file contains 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 | |
# 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