diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-17 08:07:00 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-17 08:07:00 +0200 |
| commit | 121235db5ca23e53e0dad3a402c521dc7a940fbc (patch) | |
| tree | a899aff77c6cd08ee763d418d4904e51eaf3bb5c /TODO-icons.md | |
| parent | 2c23c9cc2fa5c26e408e7276f7da7d0cb37922d6 (diff) | |
| download | waybar-theme-udt-121235db5ca23e53e0dad3a402c521dc7a940fbc.tar.gz waybar-theme-udt-121235db5ca23e53e0dad3a402c521dc7a940fbc.zip | |
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 <noreply@anthropic.com>
Diffstat (limited to 'TODO-icons.md')
| -rw-r--r-- | TODO-icons.md | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/TODO-icons.md b/TODO-icons.md new file mode 100644 index 0000000..ac904f7 --- /dev/null +++ b/TODO-icons.md @@ -0,0 +1,50 @@ +# Unhardcode the icon theme + +Done. The active icon theme is now read from +`gsettings get org.gnome.desktop.interface icon-theme`, which is what the +appearance drawer's Icons tab sets, so a switch there reaches this bar instead +of being silently reverted. + +## How it works + +`bin/wb-icon` reads the gsettings key once and resolves names through GTK's +icon lookup. Nothing else may assume a path shape: themes disagree about both +the subdirectory and the file extension (the Suru themes keep `web-browser` at +`categories/22/*.svg`, elementary-xfce at `apps/22/*.png`), so substituting one +directory prefix would have broken on any non-Suru theme. + +Two new modes serve `install.sh`: + +- `wb-icon --path NAME` prints one absolute path +- `wb-icon --theme` prints the resolved theme name + +`styles/modules.css` names icons as `@ICON:name@` placeholders and +`modules/extras/taskbar.jsonc` carries `@ICON_THEME@`; `install.sh` resolves +both at install time. taskbar.jsonc is generated for this reason and is no +longer symlinked. + +## After a theme switch + +Re-run `install.sh`, then **restart waybar**. CSS reloads itself through +`reload_style_on_change`, but `taskbar.jsonc` is config: a signal is not enough. + +## Fixed elsewhere + +- `~/.config/rofi/config.rasi` — `icon-theme` commented out, so rofi follows + the desktop theme. +- `~/.local/share/applications/firefox-clean.desktop` — absolute `Icon=` path + replaced with the bare name `firefox-aurora`, which the desktop-entry spec + resolves through the active theme (and which picks a 48px icon rather than + the 16px one that was pinned). + +## Not a conflict + +`~/.config/hypr/hyprqt6engine.conf`'s `icon_theme` is commented out. +unified-desktop-theme's `templates/qt-gtk/*` are reference copies that nothing +installs; see that repo's TODO-icons.md. + +## Caveat + +A theme lacking one of the 20 names this bar asks for fails the install at the +`--selftest` step rather than rendering empty pills. elementary-xfce, for +example, has no `text-editor` or `internet-chat`. |
