However, I really need simple systems in my work routine. Things like “hitting a stopwatch, dividing by three, and carrying over previous rest time” already feels like it’s a lot. Even though it’s just a few seconds, I prefer if these systems take as little energy as possible to maintain.
What I thought was using a simple shell script: Just start it at the beginning of work, and hit a random key whenever I switch from work to rest or vice versa. It automatically keeps track of my break times.
I don’t have Linux at home, but what I tried online ( https://www.onlinegdb.com/online_bash_shell ) is the following: (I am terrible at shell script so this is definitely not optimal, but I want to try something like this in the coming weeks. Perhaps one may want an additional warning or alarm sound if the break time gets below 0, but for me just “keeping track” is enough I think)
I like the idea a lot.
However, I really need simple systems in my work routine. Things like “hitting a stopwatch, dividing by three, and carrying over previous rest time” already feels like it’s a lot. Even though it’s just a few seconds, I prefer if these systems take as little energy as possible to maintain.
What I thought was using a simple shell script: Just start it at the beginning of work, and hit a random key whenever I switch from work to rest or vice versa. It automatically keeps track of my break times.
I don’t have Linux at home, but what I tried online ( https://www.onlinegdb.com/online_bash_shell ) is the following: (I am terrible at shell script so this is definitely not optimal, but I want to try something like this in the coming weeks. Perhaps one may want an additional warning or alarm sound if the break time gets below 0, but for me just “keeping track” is enough I think)
convertsecs() {
((h=${1}/3600))
((m=(${1}%3600)/60))
((s=${1}%60))
printf “%02d:%02d:%02d\n” $h $m $s
}
function flex_pomo() {
current=0
resttime=0
total=0
while true; do
until read -s -n 1 -t 0.01; do
sleep 3
current=$(( $current + 3 ))
resttime=$(( $resttime + 1 ))
total=$(( $total + 3 ))
printf “\rCurrently working: Current interval: $(convertsecs $current), accumulated rest: $(convertsecs $resttime), total worktime: $(convertsecs $total) ”
done
printf “\nSwitching to break\n”
current=0
until read -s -n 1 -t 0.01; do
sleep 3
current=$(( $current + 3 ))
resttime=$(( $resttime − 3 ))
printf “\rCurrently resting: Current interval: $(convertsecs $current), accumulated rest: $(convertsecs $resttime), total worktime: $(convertsecs $total) ”
done
printf “\nSwitching to work\n”
current=0
done
}
flex_pomo
Great, thanks for this. Indeed, I was thinking the whole thing could be handled neatly by an app, or Alexa skill.