dotfiles/home/.config/eww/modules/uptime.yuck

30 lines
572 B
Plaintext
Raw Normal View History

2022-10-29 18:25:42 +00:00
(defpoll uptime
:interval "1m"
:initial 'N/A'
`uptime -p | sed \\
-e 's/^up //' \\
-e 's/ years\\?,\\?/y/' \\
-e 's/ months\\?,\\?/m/' \\
-e 's/ weeks\\?,\\?/w/' \\
-e 's/ days\\?,\\?/d/' \\
-e 's/ hours\\?,\\?/h/' \\
-e 's/ minutes\\?,\\?/m/' \\
-e 's/ seconds\\?,\\?/s/' \\
| cut -d' ' -f-2`)
(defwidget uptime_module []
(eventbox
:class "module uptime"
(box
:space-evenly false
(label
:class "icon"
:text " ")
(label
:class "value"
:text {uptime}
)
)))