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 /SPEC.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 'SPEC.md')
| -rw-r--r-- | SPEC.md | 21 |
1 files changed, 13 insertions, 8 deletions
@@ -10,8 +10,9 @@ icons from the desktop's own icon theme rather than font glyphs. Three things at once: - **No font glyphs.** Every module that shows a symbol shows a real icon from - `Material-Black-Plum-Suru`, the theme GTK already uses. Icons keep their own - colours, because that is what every other application on this desktop shows. + the desktop's icon theme, which `bin/wb-icon` reads from gsettings so a theme + switch reaches the bar. Icons keep their own colours, because that is what + every other application on this desktop shows. - **Colours from udt.** Pill backgrounds, text and states resolve from `palette/roles-<scheme>.conf`, so switching scheme recolours this bar with everything else. @@ -80,7 +81,9 @@ sits before the text, which is what makes it match the rest. | 7 | `internet-chat` | chat glyph | | 8 | `input-gaming` | joypad: games and media players | -All eight resolve in `Material-Black-Plum-Suru` today. +All eight resolve in `Material-Black-Plum-Suru`, the theme this desktop runs. +`wb-icon --selftest` checks them against whatever theme is active, so a switch +to a theme missing one fails the install rather than drawing an empty pill. ## How icons reach the bar @@ -88,9 +91,11 @@ Three mechanisms, because waybar offers three and no single one covers everything. This is the part worth reading before changing anything. **1. Native `icon-theme` (taskbar, tray).** `wlr/taskbar` takes `icon-theme` -and `icon-size` outright. Today it asks for `Papirus`, **which is not -installed**, so GTK has been silently falling back. Pointing it at -`Material-Black-Plum-Suru` is a bug fix, not a preference. +and `icon-size` outright. It used to ask for `Papirus`, **which is not +installed**, so GTK silently fell back. It now carries an `@ICON_THEME@` +placeholder that `install.sh` fills from gsettings, which is why that one +module file is generated rather than symlinked. Being a config key and not +CSS, a change needs waybar restarted, not signalled. **2. The `image` module (volume, presentation mode).** `image` runs `exec` and expects `$path\n$tooltip` on stdout, so a small script maps state to an icon @@ -110,8 +115,8 @@ stylesheet, not in the config.** Changing a workspace icon means editing CSS. ### Why the icons cannot follow the accent -2466 of the 5169 panel icons in `Material-Black-Plum-Suru` carry a hardcoded -`oomox` gradient (`#a08fbf` to `#5a33a3`) and seven further named gradients +2466 of the 5169 panel icons in `Material-Black-Plum-Suru`, the theme this +desktop runs, carry a hardcoded `oomox` gradient (`#a08fbf` to `#5a33a3`) and seven further named gradients each. They are not monochrome and not recolourable by CSS `color`. So icons show their own colours and do not track the scheme, which is the intended behaviour here: they match every other application on the desktop. |
