Advertisement
Guest User

Untitled

a guest
Jul 24th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Public domain license
  4. # Not original author: Remigijus Jarmalavičius
  5. #
  6. # Usage:
  7. # pomodoro "title for work"
  8.  
  9. filename="/home/remigijus/Kodas/smelio-deze/`date '+%Y-%m-%d'`.log"
  10.  
  11. while [ 1 ]
  12. do
  13. counter=0
  14. limit=25
  15. summary="Podoro session"
  16. startmessage="Start $1!"
  17. endmessage="Done with $1! New session has started, interrupt to rest a bit."
  18. notify-send -u critical -i appointment -t 6000 "$summary" "$startmessage"
  19. echo
  20.  
  21. while [ $counter != $limit ]; do
  22. clear
  23. echo "Working on $1"
  24. echo
  25. if [ -e "$filename" ]
  26. then
  27. echo "Today:"
  28. echo
  29. sort "$filename" | awk '{print $1}' | uniq -c;
  30. fi
  31. echo
  32. echo "Progress:"
  33. echo
  34. echo -en "\t["
  35. for i in $(seq 1 $counter)
  36. do
  37. echo -n "#"
  38. done
  39. for i in $(seq 1 $(($limit-$counter)))
  40. do
  41. echo -n " "
  42. done
  43. echo -n "] $counter/$limit"
  44. echo
  45. sleep 60
  46. let "counter = $counter + 1"
  47. done
  48.  
  49. if [ $counter = $limit ]; then
  50. echo
  51. notify-send -u critical -i appointment "$summary" "$endmessage"
  52. beep
  53. echo $1 $2 >> "$filename"
  54. fi
  55. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement