fix(eww -> timer): Made timer_state.progress
more precise
This commit is contained in:
parent
07cf5d3d95
commit
a7ef774d98
2 changed files with 4 additions and 4 deletions
|
@ -6,7 +6,7 @@ PAUSE_TIME=300
|
||||||
timer_state_pid=0
|
timer_state_pid=0
|
||||||
timer_state_state="inactive"
|
timer_state_state="inactive"
|
||||||
timer_state_time="00:00"
|
timer_state_time="00:00"
|
||||||
timer_state_progress=100
|
timer_state_progress=100000
|
||||||
|
|
||||||
sub_timer_pid=0
|
sub_timer_pid=0
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ start_timer() {
|
||||||
|
|
||||||
i=$duration
|
i=$duration
|
||||||
while [ "$i" -ge 0 ] ; do
|
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')"
|
timer_state_time="$(date -u -d @$i +'%M:%S')"
|
||||||
update_timer_state
|
update_timer_state
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
|
@ -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 []
|
(defwidget start-button []
|
||||||
(button
|
(button
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
(overlay
|
(overlay
|
||||||
(circular-progress
|
(circular-progress
|
||||||
:class "circle-progress"
|
:class "circle-progress"
|
||||||
:value "${timer_state.progress}"
|
:value "${timer_state.progress / 1000}"
|
||||||
:thickness 6
|
:thickness 6
|
||||||
:start-at 75
|
:start-at 75
|
||||||
:clockwise true)
|
:clockwise true)
|
||||||
|
|
Loading…
Reference in a new issue