File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ A collection of simple Bash scripts.
15151 .  [ up.sh] ( scripts/up.sh ) : move up a directory in shell script
16161 .  [ Randomfile.sh] ( scripts/Randomfile.sh ) : create unique file/folder automatically with date and time stamp
17171 .  [ weather.sh]  (scripts/weather.sh): check the weather in a specified location or using the geolocation of the ip address by default.
18+ 1 .  [ pomodoro.sh] ( scripts/pomodoro.sh ) : a simple pomodoro app written in bash
1819
1920## Programming  
2021
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ 
3+ #  A simple shell script to use as a pomodoro app.
4+ #  The first argument is the focus time length. 
5+ #  The second argument is the break length.
6+ #  Made by Kiailandi (https://github.com/kiailandi)
7+ 
8+ wseconds=${1:- 25} * 60; 
9+ pseconds=${2:- wseconds/ 300} * 60; 
10+ 
11+ while  true ;  do 
12+ 	date1=$(( `date +% s` +  $wseconds )) ; 
13+ 	while  [ " $date1 "   -ge  ` date +%s`   ];  do 
14+   		echo  -ne " $( date -u --date @$(( $date1  -  `date +% s` ))   +%H:%M:%S)  \r" ; 
15+ 	done 
16+ 	notify-send " Break"   " Time to walk and rest" ; 
17+ 	read  -n1 -rsp $' Press any key to continue or Ctrl+C to exit...\n ' ; 
18+ 	date2=$(( `date +% s` +  $pseconds )) ; 
19+ 	while  [ " $date2 "   -ge  ` date +%s`   ];  do 
20+   		echo  -ne " $( date -u --date @$(( $date2  -  `date +% s` ))   +%H:%M:%S)  \r" ; 
21+ 	done 
22+ 	notify-send " Work"   " Time to get back to work" ; 
23+ 	read  -n1 -rsp $' Press any key to continue or Ctrl+C to exit...\n ' ; 
24+ done 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments