diff options
| author | ryukamish <[email protected]> | 2026-04-11 23:13:59 +0530 |
|---|---|---|
| committer | ryukamish <[email protected]> | 2026-04-11 23:13:59 +0530 |
| commit | 909a6da9cf342ccc4d1eef0dbdb12b56d211fafe (patch) | |
| tree | 3a88ca28ff8f5cfc7b24d194ac1a84f6214d0010 | |
| parent | 7486374c3679c85ebf7670c7976e607d1509be1b (diff) | |
add: visual indicators with uptime module
| -rw-r--r-- | waybar/config.jsonc | 18 | ||||
| -rw-r--r-- | waybar/style.css | 4 | ||||
| -rwxr-xr-x | waybar/uptime | 6 |
3 files changed, 23 insertions, 5 deletions
diff --git a/waybar/config.jsonc b/waybar/config.jsonc index abae8c3..80462d7 100644 --- a/waybar/config.jsonc +++ b/waybar/config.jsonc @@ -4,10 +4,12 @@ "modules-left": [ "clock", "custom/screenrecording-indicator", - "niri/window" + "niri/window", + "custom/uptime" ], "modules-center": [ - "custom/workspaces" + "custom/workspaces", + "niri/workspaces" ], "modules-right": [ "tray", @@ -20,11 +22,11 @@ ], "niri/workspaces": { "current-only": true, - "format": "{icon}", - "all-outputs": false // usually keep false so each monitor shows its own active workspace + "format": "{value}" }, "niri/window": { - "format": "{app_id}" + "format": "{app_id} | {title}", + "max-length": 30 }, "clock": { "format": "{:%a, %b %d %H:%M}" @@ -118,5 +120,11 @@ "exec": "~/.config/waybar/waybar-screenrecord", "signal": 8, "return-type": "json" + }, + "custom/uptime": { + "format": "{}", + "interval": 1600, + "tooltip": false, + "exec": "~/.config/waybar/uptime" } } diff --git a/waybar/style.css b/waybar/style.css index 07e2661..40f6ffa 100644 --- a/waybar/style.css +++ b/waybar/style.css @@ -13,8 +13,10 @@ window#waybar { #workspaces button { padding: 0 6px; + color: #cccccc; } +/* Different battery states indicator */ #battery.discharging.warning { color: #ffa500; } @@ -27,6 +29,7 @@ window#waybar { #battery, #window, #custom-brightness, +#custom-uptime, #memory, #network, #mpris, @@ -42,6 +45,7 @@ window#waybar { #bluetooth, #pulseaudio, #custom-brightness, +#custom-uptime, #battery { color: #cccccc; } diff --git a/waybar/uptime b/waybar/uptime new file mode 100755 index 0000000..d01e388 --- /dev/null +++ b/waybar/uptime @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +UPTIME_PRETTY=$(uptime -p) + +UPTIME_FORMATTED=$(echo "$UPTIME_PRETTY" | sed 's/^up //;s/,*$//;s/minute/M/; s/hour/H/; s/day/D/; s/s//g') + +echo "$UPTIME_FORMATTED" |
