From 8c6ae68298393cbd1026534754fb1ec33e16960d Mon Sep 17 00:00:00 2001 From: tekki Date: Wed, 22 Apr 2026 19:29:31 +0200 Subject: [PATCH] feat: show window icons per workspace in waybar Adds {windows} format to hyprland/workspaces with icon mapping for common apps (terminal, browser, file manager, editor, media, etc.). Icons are dimmed and smaller than the workspace number. Co-Authored-By: Claude Sonnet 4.6 --- config/wal/generate.py | 22 ++++++++++++++++++++++ config/waybar/config.jsonc | 33 +++++++++++++++++++++++++++------ 2 files changed, 49 insertions(+), 6 deletions(-) diff --git a/config/wal/generate.py b/config/wal/generate.py index 6a519a0..a46738c 100644 --- a/config/wal/generate.py +++ b/config/wal/generate.py @@ -13,6 +13,7 @@ bg = c['special']['background'] fg = c['special']['foreground'] pink = c['colors']['color1'] green = c['colors']['color2'] +warn = c['colors']['color3'] muted = c['colors']['color8'] dark = c['colors']['color0'] @@ -51,6 +52,11 @@ window#waybar.bottom {{ font-style: italic; }} +#custom-notification.critical {{ + color: {pink}; + font-style: italic; +}} + #disk, #network.speed {{ padding: 1px 8px; @@ -87,6 +93,12 @@ window#waybar.bottom {{ animation: blink 0.6s steps(1) infinite; }} +#workspaces button .windows-icon {{ + font-size: 9px; + color: {muted}; + margin-left: 2px; +}} + #window {{ color: {muted}; padding: 0 10px; @@ -102,6 +114,7 @@ window#waybar.bottom {{ #cpu, #memory, #temperature, +#battery, #network, #pulseaudio, #tray {{ @@ -111,6 +124,15 @@ window#waybar.bottom {{ transition: all 0.2s ease; }} +#battery.warning {{ + color: {warn}; +}} + +#battery.critical {{ + color: {pink}; + animation: blink 1s steps(1) infinite; +}} + #cpu:hover, #memory:hover, #network:hover, diff --git a/config/waybar/config.jsonc b/config/waybar/config.jsonc index 8940e06..bd22c3a 100644 --- a/config/waybar/config.jsonc +++ b/config/waybar/config.jsonc @@ -25,7 +25,28 @@ ], "hyprland/workspaces": { - "format": "{id}", + "format": "{id} {windows}", + "format-window-separator": " ", + "window-rewrite-default": "", + "window-rewrite": { + "class": "", + "class": "", + "class": "", + "class": "", + "class": "", + "class": "", + "class": "", + "class": "", + "class": "", + "class": "", + "class": "", + "class": "", + "class": "", + "class": "", + "class": "", + "class": "", + "class": "" + }, "on-scroll-up": "hyprctl dispatch workspace e+1", "on-scroll-down": "hyprctl dispatch workspace e-1", "all-outputs": false @@ -73,8 +94,8 @@ "format-plugged": "\uf1e6 {capacity}%", "format-icons": ["\uf244", "\uf243", "\uf242", "\uf241", "\uf240"], "states": { - "warning": 30, - "critical": 15 + "warning": 85, + "critical": 80 }, "tooltip-format": "{timeTo}, {power:.1f}W" }, @@ -124,11 +145,11 @@ }, "custom/notification": { - "exec": "[ -f /tmp/waybar-notif ] && echo \"\uf0f3 $(cat /tmp/waybar-notif)\" || echo ''", + "exec": "~/.config/waybar/notif-status.sh", + "return-type": "json", "interval": 2, - "format": "{}", "max-length": 80, - "on-click": "rm -f /tmp/waybar-notif" + "on-click": "rm -f /tmp/waybar-notif /tmp/waybar-notif-urgency" }, "disk": {