diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-15 17:24:02 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-15 17:24:02 +0200 |
| commit | a595fc7ca575de9de87f1311f3113f6fd4c6c326 (patch) | |
| tree | d359b86a3d7dcdeb219b2d84768879b0782e8f88 /install.sh | |
| parent | 7f52e94d2386858cb32c18d5a5982dbb966cb174 (diff) | |
| download | waybar-theme-udt-a595fc7ca575de9de87f1311f3113f6fd4c6c326.tar.gz waybar-theme-udt-a595fc7ca575de9de87f1311f3113f6fd4c6c326.zip | |
fix: give the launcher a mark for each state
The pill inverts on hover, so one mark could never work: filled dark it
vanished on the dark hover background, filled light it would vanish on the
accent pill at rest. Both halves of that shipped, one after the other.
Removing the hover rule did not help either, because the GTK theme paints its
own hover shade on the button node underneath. Declining to set a background
does not leave the pill alone, it leaves that shade in charge.
So the mark moves out of the image module and into CSS, where a
background-image can be swapped per state: dark on the accent pill at rest,
light on the dark pill hovered, with the hover background set explicitly
rather than left to the theme. install.sh generates both tints from one source
file, so they cannot drift apart in shape.
That makes the launcher a custom module, since an image module's path is read
once and CSS cannot reach inside it. Its format is a single space for the
usual reason: an empty one draws no widget at all.
install.sh also removes the file the old image module left behind. The prune
only clears dangling symlinks, and that one was written as a real file, so
nothing had been removing it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'install.sh')
| -rwxr-xr-x | install.sh | 40 |
1 files changed, 19 insertions, 21 deletions
@@ -90,6 +90,7 @@ for f in modules/clock.jsonc \ modules/hyprland/workspaces.jsonc \ modules/custom/vmdot.jsonc modules/custom/privacy_dots.jsonc \ modules/custom/presentation.jsonc modules/custom/mail.jsonc \ + modules/custom/launcher.jsonc \ modules/extras/taskbar.jsonc modules/extras/tray.jsonc \ modules/image/volume.jsonc modules/image/language.jsonc; do ln -sfn "$repo/$f" "$target/$f" @@ -104,31 +105,28 @@ done sed -e "s|@ICONS@|$icons|g" -e "s|@CONFIG@|$target|g" \ "$repo/styles/modules.css" > "$target/styles/modules.css" -# The launcher module is generated for the same reason. A module's `path` is -# NOT shell-expanded the way `exec` is, so it needs the absolute path written -# in: with "$HOME/..." waybar finds no file and the module draws nothing, with -# no error to say why. -# -# The target is removed first. An earlier install symlinked this file, and a -# redirect onto a surviving link writes THROUGH it: the shell truncates the -# link's target, which is the repo's own copy, before sed reads it. That -# emptied the source file once already. -rm -f "$target/modules/image/launcher.jsonc" -sed "s|@CONFIG@|$target|g" \ - "$repo/modules/image/launcher.jsonc" > "$target/modules/image/launcher.jsonc" +# The launcher module carries no generated path any more: its mark is a CSS +# background, so modules.css owns the paths and the module file is a plain +# symlink like every other. # The flags ship as they are; the Slackware mark is monochrome, so it is -# tinted here. It sits ON the accent pill, so it takes the bar's background -# colour rather than the accent: filled with the accent it would be invisible -# against its own pill, which is exactly what the first version did. -mark="$(sed -n 's/^@define-color main-bg *\(.*\);$/\1/p' "$target/styles/theme.css" | head -1)" -mark="${mark:-#24273a}" -sed "s|@ACCENT@|$mark|" "$repo/icons/slackware.svg" > "$target/slackware.svg" +# tinted here, twice. The pill inverts on hover, so the mark has to invert +# with it: dark on the accent pill at rest, light on the dark pill hovered. +# One mark and one pill colour would always collide in one of the two states, +# which is exactly what shipped twice before this. +mark_dark="$(sed -n 's/^@define-color main-bg *\(.*\);$/\1/p' "$target/styles/theme.css" | head -1)" +mark_light="$(sed -n 's/^@define-color main-fg *\(.*\);$/\1/p' "$target/styles/theme.css" | head -1)" +mark_dark="${mark_dark:-#24273a}" +mark_light="${mark_light:-#cad3f5}" +sed "s|@ACCENT@|$mark_dark|" "$repo/icons/slackware.svg" > "$target/slackware.svg" +sed "s|@MARK_LIGHT@|$mark_light|" "$repo/icons/slackware-light.svg" > "$target/slackware-light.svg" install -Dm644 "$repo/icons/flag-it.svg" "$target/flag-it.svg" install -Dm644 "$repo/icons/burger.svg" "$target/burger.svg" -# The UK flag was replaced by the hamburger for English; drop a copy left by -# an earlier install, or wb-lang's old target lingers on disk unreferenced. -rm -f "$target/flag-gb.svg" +# Files an earlier install generated that nothing references any more. The +# prune above only clears dangling SYMLINKS, and these were written as real +# files, so nothing else removes them: the UK flag the hamburger replaced, and +# the launcher from when it was an image module. +rm -f "$target/flag-gb.svg" "$target/modules/image/launcher.jsonc" # ---------------------------------------------------------------- scripts -- # The two dot scripts used to live only in ~/bin, in no repository at all. |
