From 909a6da9cf342ccc4d1eef0dbdb12b56d211fafe Mon Sep 17 00:00:00 2001 From: ryukamish Date: Sat, 11 Apr 2026 23:13:59 +0530 Subject: add: visual indicators with uptime module --- waybar/config.jsonc | 18 +++++++++++++----- waybar/style.css | 4 ++++ waybar/uptime | 6 ++++++ 3 files changed, 23 insertions(+), 5 deletions(-) create mode 100755 waybar/uptime (limited to 'waybar') 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" -- cgit v1.3