Created
December 19, 2017 15:44
-
-
Save mpdmanash/3b72e7c79ded43f87280fd6e6baa56de to your computer and use it in GitHub Desktop.
Revisions
-
Manash Pratim Das created this gist
Dec 19, 2017 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ #!/bin/sh % add @reboot work/tools/scripts/pomodoro.sh to crontab -e % or add to sudo nano /etc/rc.local % or add to "Run at startup" in Ubuntu study_time_sec="1500"; % in seconds break_time_sec="300"; % in seconds % Produced an alarm _alarm() { ( \speaker-test --frequency $1 --test sine )& pid=$! \sleep 0.${2}s \kill -9 $pid } study=true; while true; do if $study ; then study=false; notify-send "Come on! Get to work!"; _alarm 100 200; _alarm 200 200; _alarm 300 200; sleep $study_time_sec; else study=true; notify-send "Its time to take some rest"; _alarm 400 200; _alarm 500 200; sleep $break_time_sec; fi done