dotfiles/home/.config/eww/modules/uptime.yuck
2022-11-20 03:14:18 +01:00

30 lines
572 B
Plaintext

(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}
)
)))