aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md16
-rw-r--r--SPEC.md4
-rw-r--r--config.jsonc4
-rw-r--r--icons/slackware-light.svg12
-rwxr-xr-xinstall.sh40
-rw-r--r--modules/custom/launcher.jsonc22
-rw-r--r--modules/image/launcher.jsonc19
-rw-r--r--styles/modules.css49
-rw-r--r--styles/pills.css6
9 files changed, 100 insertions, 72 deletions
diff --git a/README.md b/README.md
index 6abc653..b39aee2 100644
--- a/README.md
+++ b/README.md
@@ -44,8 +44,8 @@ single one covers everything:
| Mechanism | Used by | Why |
| --- | --- | --- |
| `icon-theme` config key | taskbar, tray | Native support, nothing else needed. |
-| `image` module | launcher, volume, microphone, language | Takes a path: either static, or from a script that resolves the current state. |
-| CSS `background-image` | workspaces, clock, mail, presentation mode | `format-icons` takes text, not paths. |
+| `image` module | volume, microphone, language | Takes a path from a script that resolves the current state. |
+| CSS `background-image` | workspaces, clock, mail, presentation mode, launcher | `format-icons` takes text, not paths, and CSS can swap the image per state. |
The consequence worth knowing: **the workspace icons live in
`styles/modules.css`, not in the module config.** Changing one means editing
@@ -67,11 +67,13 @@ with nothing to say why, so it fails while someone is watching instead.
gradient and are not recolourable. That is intended here: icons match the rest
of the desktop rather than the bar.
-The three 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, so `install.sh` tints it from the palette. It is filled with the
-bar's background colour rather than the accent, because it sits on the accent
-pill and the accent would render it invisible against itself.
+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,
+so `install.sh` tints it from the palette, **twice**: the launcher pill
+inverts on hover, so the mark has to invert with it, dark on the accent pill
+at rest and light on the dark pill hovered. One mark would be invisible in one
+of the two states, which is what shipped twice before this. Both tints are
+generated from one source file, so they cannot drift apart in shape.
`icons/flag-it.svg` and `icons/burger.svg` (Twemoji, CC-BY 4.0) keep their own
colours. The hamburger stands in for the English layout, which is what the
diff --git a/SPEC.md b/SPEC.md
index 54e6d62..8042637 100644
--- a/SPEC.md
+++ b/SPEC.md
@@ -47,7 +47,7 @@ transparent gaps, so the bar reads as groups rather than a continuous strip.
| Position | Module | Icon source | Notes |
| --- | --- | --- | --- |
-| DP-1 centre | `image#launcher` | `slackware.svg`, shipped here | Accent background, the one always-coloured pill. Opens the quickshell drawer. An `image` module: a `custom` one draws nothing when its format is empty, and the format has to be empty because the mark is an icon. |
+| DP-1 centre | `custom/launcher` | `slackware.svg` + `slackware-light.svg`, shipped here | Accent background, the one always-coloured pill. Opens the quickshell drawer. A `custom` module with the mark as a CSS background, because CSS can swap the image on `:hover` and cannot reach inside an `image` module. Its format is a single space: an empty one draws no widget at all. |
| left | `clock#date` | `x-office-calendar` | Icon then text. Calendar tooltip kept. |
| left | `clock#time` | `clock` | Icon then text. |
| left | `hyprland/workspaces` | eight themed icons, via CSS | See below. |
@@ -134,7 +134,7 @@ Modular, one file per module, mirroring the current setup:
workspaces.jsonc
language.jsonc
custom/
- launcher.jsonc
+ launcher.jsonc the drawer button, mark drawn in CSS
vmdot.jsonc
extras/
taskbar.jsonc
diff --git a/config.jsonc b/config.jsonc
index 58944aa..d93907c 100644
--- a/config.jsonc
+++ b/config.jsonc
@@ -51,7 +51,7 @@
{
"include": [
"$HOME/.config/waybar-udt/modules/hyprland/workspaces.jsonc",
- "$HOME/.config/waybar-udt/modules/image/launcher.jsonc",
+ "$HOME/.config/waybar-udt/modules/custom/launcher.jsonc",
"$HOME/.config/waybar-udt/modules/extras/taskbar.jsonc",
],
@@ -59,7 +59,7 @@
"hyprland/workspaces"
],
"modules-center": [
- "image#launcher"
+ "custom/launcher"
],
"modules-right": [
"wlr/taskbar"
diff --git a/icons/slackware-light.svg b/icons/slackware-light.svg
new file mode 100644
index 0000000..74e6911
--- /dev/null
+++ b/icons/slackware-light.svg
@@ -0,0 +1,12 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
+ <!-- Slackware logo, from Simple Icons (CC0 1.0 Universal).
+ @MARK_LIGHT@ is substituted by install.sh with the bar's background colour,
+ not the accent: the mark sits on the accent pill, and filling it with
+ the accent would draw it on top of itself.
+
+ The root <svg> element stays the FIRST thing in this file. gdk-pixbuf
+ sniffs the opening bytes for "<svg" to pick its loader, so a comment
+ before the root tag pushes it out of that window and every consumer
+ reports "couldn't recognize the image file format" on valid XML. -->
+ <path fill="@MARK_LIGHT@" d="M12.924 1.228c-.584-.01-1.251 0-1.485.027-2.46.282-4.138 1.3-4.753 2.891-.218.552-.274 1.002-.243 1.772.048 1.21.419 2.004 1.262 2.742 1.225 1.06 2.98 1.508 5.998 1.508 2.737 0 3.71.413 3.916 1.675.313 1.867-1.57 3.07-4.414 2.827-1.878-.16-3.496-.912-4.223-1.967a7.772 7.772 0 01-.355-.62c-.382-.76-.64-.978-1.176-.978-.43.005-.732.165-.918.494l-.133.24v4.03l.137.296c.165.344.4.546.744.63.35.09.794-.036 1.42-.402l.5-.29.826.185c1.82.403 2.75.523 4.065.523 1.103.005 1.548-.046 2.455-.285 1.124-.297 1.974-.785 2.717-1.57.8-.844 1.15-1.853 1.097-3.147-.069-1.628-.695-2.698-2-3.414-.96-.525-2.292-.79-4.377-.88-2.042-.086-2.794-.155-3.515-.32-.51-.12-.785-.25-1.076-.515-.653-.589-.59-1.755.136-2.482.642-.637 1.511-.928 2.774-.928 1.432.005 2.393.27 3.412.955.185.127.721.62 1.193 1.092.886.902 1.135 1.082 1.506 1.082.244 0 .59-.163.732-.344.26-.329.303-.63.303-2.2 0-1.66-.043-1.91-.377-2.282-.387-.425-.848-.42-1.75.031l-.59.297-.63-.17c-1.496-.392-2.038-.477-3.178-.504zM0 13.775v9h24v-1H1v-8z"/>
+</svg>
diff --git a/install.sh b/install.sh
index bae549c..cf4965d 100755
--- a/install.sh
+++ b/install.sh
@@ -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.
diff --git a/modules/custom/launcher.jsonc b/modules/custom/launcher.jsonc
new file mode 100644
index 0000000..9aa901c
--- /dev/null
+++ b/modules/custom/launcher.jsonc
@@ -0,0 +1,22 @@
+// Opens the quickshell desktop drawer. A static button: no "exec", so it
+// cannot show whether the drawer is open, which would need the shell to feed
+// waybar.
+//
+// A custom module rather than an image one, because the mark has to change
+// between the resting and hover states. An image module's `path` is read once
+// and CSS cannot reach it, so the mark could not be swapped; a CSS
+// background-image can, which is the same mechanism the workspaces, the clock
+// and the mail pill already use.
+//
+// The format is a single space, and it has to be something. It defaults to
+// "{text}", a static custom module has no text, and waybar draws no widget at
+// all for a custom module whose formatted output is empty: not an empty pill,
+// no pill. A space gives the label real content to be allocated for and shows
+// nothing itself.
+{
+ "custom/launcher": {
+ "format": " ",
+ "tooltip": false,
+ "on-click": "qs -p $HOME/Programming/GIT/quickshell/desktop ipc call drawer toggle"
+ }
+}
diff --git a/modules/image/launcher.jsonc b/modules/image/launcher.jsonc
deleted file mode 100644
index 7c7b979..0000000
--- a/modules/image/launcher.jsonc
+++ /dev/null
@@ -1,19 +0,0 @@
-// Opens the quickshell desktop drawer. A static button: no state, because
-// waybar cannot see whether the drawer is open without the shell feeding it.
-//
-// An `image` module rather than a custom one: a custom module draws nothing at
-// all when its format is empty, and the format has to be empty because the
-// mark is an icon rather than text. `image` takes a path and needs no label.
-//
-// This file is GENERATED into place by install.sh, not symlinked: `path` is
-// not shell-expanded the way `exec` is, so a "$HOME/..." here is taken
-// literally, no file is found, and the module draws nothing without saying so.
-// @CONFIG@ becomes the absolute install directory.
-{
- "image#launcher": {
- "path": "@CONFIG@/slackware.svg",
- "size": 18,
- "tooltip": false,
- "on-click": "qs -p $HOME/Programming/GIT/quickshell/desktop ipc call drawer toggle"
- }
-}
diff --git a/styles/modules.css b/styles/modules.css
index cac68da..9131752 100644
--- a/styles/modules.css
+++ b/styles/modules.css
@@ -10,28 +10,41 @@
* Launcher: the one always-coloured pill, and the desktop's identity. *
* ------------------------------------------------------------------ */
-/* The mark itself is the image module's own content, so this only draws the
- * pill it sits in. The horizontal padding is wider than the vertical so the
- * pill reads as a capsule like its neighbours rather than a circle: an image
- * module sizes to its icon, where the others size to their text. */
-#image.launcher {
- background: @accent;
+/* Launcher: two marks, one per state.
+ *
+ * The mark is a CSS background rather than an image module's content, which
+ * is what makes this possible at all: CSS can swap a background-image on
+ * :hover, but it cannot reach inside an image module to recolour what that
+ * module drew.
+ *
+ * Two files, same path, different fill: dark on the accent pill at rest,
+ * light on the dark pill when hovered. install.sh generates both from one
+ * source, so they cannot drift apart in shape.
+ *
+ * The hover background is set explicitly rather than left out. The GTK theme
+ * paints its own hover shade on the button node underneath, so declining to
+ * set one does not leave the pill alone, it leaves the shade in charge, and
+ * the pill went dark with the dark mark on it. That was the second version of
+ * this bug; the first filled the mark with @accent and drew it on the @accent
+ * pill.
+ *
+ * min-height is load-bearing: the label is a single space, so without it the
+ * background paints into a box with almost no height. */
+#custom-launcher {
+ background-color: @accent;
+ background-image: url("@CONFIG@/slackware.svg");
+ background-repeat: no-repeat;
+ background-position: center;
+ background-size: 18px 18px;
padding: 2px 14px;
min-width: 20px;
+ min-height: 18px;
}
-/* This pill deliberately has NO hover background.
- *
- * The mark is a rendered image inside the module, not a CSS background, so
- * CSS cannot recolour it for a hover state. It is filled with @main-bg to
- * contrast against the accent pill, which means any hover that sets the
- * background to @main-bg paints the mark in its own colour and the pill goes
- * blank. That shipped twice: first filled with @accent on an @accent pill,
- * then hovering to @main-bg with an @main-bg mark.
- *
- * Changing the background here at all requires a colour that contrasts with
- * BOTH @accent and @main-bg, which the palette does not owe us. So the pill
- * holds its colour and the cursor alone signals it is clickable. */
+#custom-launcher:hover {
+ background-color: @main-bg;
+ background-image: url("@CONFIG@/slackware-light.svg");
+}
/* ---------------------------------------------- *
* Clock: the only text, each with a leading icon. *
diff --git a/styles/pills.css b/styles/pills.css
index 1794523..7bc9947 100644
--- a/styles/pills.css
+++ b/styles/pills.css
@@ -12,7 +12,7 @@
/* Every pill. Shared geometry lives here exactly once; modules.css only says
* what is different about each one. */
-#image.launcher,
+#custom-launcher,
#clock.date,
#clock.time,
#workspaces,
@@ -70,8 +70,8 @@
margin-right: 6px;
}
-/* Top bar, centre: the launcher stands alone. */
-#image.launcher {
+/* DP-1 centre: the launcher stands alone. */
+#custom-launcher {
margin-left: 6px;
margin-right: 6px;
}