mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2024-11-10 02:39:40 +00:00
30 lines
572 B
Plaintext
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}
|
|
)
|
|
)))
|