20241115
This commit is contained in:
parent
d95e42494e
commit
7aee7348cf
10 changed files with 114 additions and 59 deletions
24
linux/.config/polybar/rest_timer_module/rest_timer.sh
Executable file
24
linux/.config/polybar/rest_timer_module/rest_timer.sh
Executable file
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
source ~/.config/polybar/rest_timer_module/config.sh
|
||||
if [[ ! -f "$STATE_REST_TIMER" ]]; then
|
||||
echo $(("$TOTAL_MINUTES" * 60)) >"$STATE_REST_TIMER"
|
||||
fi
|
||||
# END_TIME=$(($(date +%s) + TIMER))
|
||||
|
||||
REMAINING=$(cat "$STATE_REST_TIMER")
|
||||
|
||||
if [[ $REMAINING -le 0 ]]; then
|
||||
echo "%{F#FF0000}Time to rest!%{F-}"
|
||||
# rm "$STAT_REST_TIMER"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
MINUTES=$((REMAINING / 60))
|
||||
SECONDS=$((REMAINING % 60))
|
||||
printf "%02d:%02d\n" $MINUTES $SECONDS
|
||||
|
||||
REMAINING=$((REMAINING - 1))
|
||||
echo $REMAINING >"$STATE_REST_TIMER"
|
||||
|
||||
sleep 1
|
Loading…
Add table
Add a link
Reference in a new issue