fix(eww -> timer): Made timer_state.progress more precise

This commit is contained in:
GaspardCulis 2024-10-07 21:57:33 +02:00
parent 07cf5d3d95
commit a7ef774d98
2 changed files with 4 additions and 4 deletions

View file

@ -6,7 +6,7 @@ PAUSE_TIME=300
timer_state_pid=0
timer_state_state="inactive"
timer_state_time="00:00"
timer_state_progress=100
timer_state_progress=100000
sub_timer_pid=0
@ -29,7 +29,7 @@ start_timer() {
i=$duration
while [ "$i" -ge 0 ] ; do
timer_state_progress=$((i * 100 / duration))
timer_state_progress=$((i * 100000 / duration))
timer_state_time="$(date -u -d @$i +'%M:%S')"
update_timer_state
sleep 1

View file

@ -1,4 +1,4 @@
(deflisten timer_state :initial '{"pid": 0, "state": "inactive", "time": "00:00", "progress": 100}' "~/.config/eww/scripts/timer")
(deflisten timer_state :initial '{"pid": 0, "state": "inactive", "time": "00:00", "progress": 100000}' "~/.config/eww/scripts/timer")
(defwidget start-button []
(button
@ -8,7 +8,7 @@
(overlay
(circular-progress
:class "circle-progress"
:value "${timer_state.progress}"
:value "${timer_state.progress / 1000}"
:thickness 6
:start-at 75
:clockwise true)