From 121235db5ca23e53e0dad3a402c521dc7a940fbc Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Thu, 17 Sep 2026 08:07:00 +0200 Subject: feat(icons): read the icon theme from gsettings The icon theme name was hardcoded in three places (bin/wb-icon, modules/extras/taskbar.jsonc and install.sh), so switching themes in the appearance drawer was silently reverted as far as this bar was concerned. wb-icon now reads org.gnome.desktop.interface icon-theme and gains two modes for install.sh: --path NAME prints one icon's absolute path, --theme prints the resolved theme name. Icons are resolved per name rather than by substituting a directory prefix, because themes disagree about both subdirectory and file extension: the Suru themes keep web-browser at categories/22/*.svg, elementary-xfce at apps/22/*.png. Only a real GTK lookup knows the path. styles/modules.css therefore carries @ICON:name@ placeholders and modules/extras/taskbar.jsonc carries @ICON_THEME@, both filled at install time. taskbar.jsonc is generated rather than symlinked for that reason, and install.sh removes the old symlink first so the redirect cannot overwrite the committed source. A theme missing one of the twenty names fails the install at the --selftest step rather than drawing empty pills. Co-Authored-By: Claude Opus 5 --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index e7d8b58..2c85675 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,10 @@ from there, and `install.sh` fails clearly if it is missing. ## No glyphs -Every symbol on this bar is a real icon from `Material-Black-Plum-Suru`, the -theme GTK already uses. Icons keep their own colours, matching every other -application on the desktop. +Every symbol on this bar is a real icon from the desktop's icon theme, read +from gsettings, so the bar follows a theme switch instead of naming one theme +forever. Icons keep their own colours, matching every other application on the +desktop. waybar offers three ways to draw one, and this bar uses all three because no single one covers everything: @@ -63,9 +64,9 @@ with nothing to say why, so it fails while someone is watching instead. ### Why the icons do not follow the accent -2466 of the 5169 panel icons in `Material-Black-Plum-Suru` carry a hardcoded -gradient and are not recolourable. That is intended here: icons match the rest -of the desktop rather than the bar. +2466 of the 5169 panel icons in `Material-Black-Plum-Suru`, the theme this +desktop runs, carry a hardcoded gradient and are not recolourable. That is +intended here: icons match the rest of the desktop rather than the bar. The icons this repo ships are the exception, because the icon theme has none of them. `icons/slackware.svg` (Simple Icons, CC0) is single-path monochrome, -- cgit v1.2.3