From 213270aef5cb2e7f96cb38f62472ef275f5ecb93 Mon Sep 17 00:00:00 2001 From: ryukamish Date: Sun, 12 Jul 2026 12:32:54 +0530 Subject: add: custom window title module for waybar --- .config/waybar/config.jsonc | 15 +++++++++++---- .config/waybar/style.css | 2 +- .local/bin/waybar-window | Bin 0 -> 1133392 bytes 3 files changed, 12 insertions(+), 5 deletions(-) create mode 100755 .local/bin/waybar-window diff --git a/.config/waybar/config.jsonc b/.config/waybar/config.jsonc index a5ac16f..3b6dde6 100644 --- a/.config/waybar/config.jsonc +++ b/.config/waybar/config.jsonc @@ -3,7 +3,7 @@ "position": "top", "modules-left": [ "clock", - "sway/window" + "custom/window" ], "modules-center": [ "sway/workspaces" @@ -21,9 +21,16 @@ "all-outputs": true, "format": "{name}" }, - "sway/window": { - "format": "{app_id} {title}", - "max-length": 40 + "custom/window": { + "exec": "~/.local/bin/waybar-window", + "exec-if": "~/.local/bin/waybar-window", + "format": "{}", + "return-type": "json", + "max-length": 60, + "tooltip": false, + // titles where special characters are present weren't being shown + // this solves that + "escape": true }, "clock": { "format": "{:%a, %b %d/%m/%y %H:%M}", diff --git a/.config/waybar/style.css b/.config/waybar/style.css index 21487b3..58464b9 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -32,7 +32,7 @@ window#waybar { #clock, #battery, -#window, +#custom-window, #backlight, /* Custom modules */ #custom-vpn, diff --git a/.local/bin/waybar-window b/.local/bin/waybar-window new file mode 100755 index 0000000..807b29b Binary files /dev/null and b/.local/bin/waybar-window differ -- cgit v1.3