Add uptime module

This commit is contained in:
Ivan Bushchik 2022-12-08 17:55:26 +03:00
parent 2945051b03
commit 7627920b78
No known key found for this signature in database
GPG key ID: 3E4E9C7D66E44BF7
2 changed files with 8 additions and 2 deletions

View file

@ -2,7 +2,7 @@
"position": "top", "position": "top",
"modules-left": ["sway/workspaces", "sway/mode"], "modules-left": ["sway/workspaces", "sway/mode"],
"modules-center": [], "modules-center": [],
"modules-right": ["idle_inhibitor", "cpu", "temperature", "memory", "custom/loadavg", "network", "pulseaudio", "battery", "sway/language", "clock", "tray"], "modules-right": ["idle_inhibitor", "cpu", "temperature", "memory", "custom/loadavg", "custom/uptime", "network", "pulseaudio", "battery", "sway/language", "clock", "tray"],
"sway/mode": { "sway/mode": {
"format": "<span style=\"italic\">{}</span>" "format": "<span style=\"italic\">{}</span>"
}, },
@ -42,6 +42,12 @@
"format": "Load average: {}", "format": "Load average: {}",
"interval": 1 "interval": 1
}, },
"custom/uptime": {
"exec": "uptime -p | sed 's/up //g' -",
"return-type": "{}",
"format": "Uptime: {}",
"interval": 60,
},
"temperature": { "temperature": {
"format": "Temperature: {temperatureC}°C", "format": "Temperature: {temperatureC}°C",
"interval": 1 "interval": 1

View file

@ -57,7 +57,7 @@ button:hover {
border-radius: 32px; border-radius: 32px;
} }
#language, #clock, #battery, #cpu, #memory, #disk, #temperature, #backlight, #network, #pulseaudio, #custom-media, #tray, #mode, #idle_inhibitor, #mpd, #custom-loadavg { #language, #clock, #battery, #cpu, #memory, #disk, #temperature, #backlight, #network, #pulseaudio, #custom-media, #tray, #mode, #idle_inhibitor, #mpd, #custom-loadavg, #custom-uptime {
padding: 0 8px; padding: 0 8px;
} }