20241115
This commit is contained in:
parent
d95e42494e
commit
7aee7348cf
10 changed files with 114 additions and 59 deletions
|
@ -83,7 +83,7 @@ font-2 = "Font Awesome 6 Free"
|
|||
; font-2 = JetBrainsMono Nerd Font Mono:size=21:style=Regular;2
|
||||
|
||||
modules-left = i3 xwindow
|
||||
modules-right = pulseaudio xkeyboard wlan systray date
|
||||
modules-right = rest_timer pulseaudio xkeyboard wlan systray date
|
||||
|
||||
cursor-click = pointer
|
||||
cursor-scroll = ns-resize
|
||||
|
@ -298,6 +298,13 @@ bar-empty = ─
|
|||
; click-left = blueman-manager
|
||||
; content = "bt"
|
||||
|
||||
[module/rest_timer]
|
||||
type = custom/script
|
||||
exec = ~/.config/polybar/rest_timer_module/rest_timer.sh
|
||||
; interval = 1
|
||||
tail = true
|
||||
click-left = ~/.config/polybar/rest_timer_module/reset_rest_timer.sh &
|
||||
|
||||
[settings]
|
||||
screenchange-reload = true
|
||||
pseudo-transparency = true
|
||||
|
|
2
linux/.config/polybar/rest_timer_module/config.sh
Executable file
2
linux/.config/polybar/rest_timer_module/config.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
TOTAL_MINUTES=40
|
||||
STATE_REST_TIMER="/tmp/state_rest_timer_polybar"
|
5
linux/.config/polybar/rest_timer_module/reset_rest_timer.sh
Executable file
5
linux/.config/polybar/rest_timer_module/reset_rest_timer.sh
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
source ~/.config/polybar/rest_timer_module/config.sh
|
||||
|
||||
echo $(("$TOTAL_MINUTES" * 60)) >"$STATE_REST_TIMER"
|
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