diff options
| -rw-r--r-- | README.md | 25 | ||||
| -rw-r--r-- | SPEC.md | 56 | ||||
| -rwxr-xr-x | bin/wb-lang | 11 | ||||
| -rw-r--r-- | config.jsonc | 8 | ||||
| -rw-r--r-- | icons/burger.svg | 10 | ||||
| -rw-r--r-- | icons/flag-gb.svg | 7 | ||||
| -rwxr-xr-x | install.sh | 5 |
7 files changed, 70 insertions, 52 deletions
@@ -4,8 +4,8 @@ Two waybar bars for DP-3: pill clusters, icons from the desktop's own icon theme instead of font glyphs, and colours driven by [unified-desktop-theme](../unified-desktop-theme). - DP-3 [📅 Wed 15/09] [🕑 14:32] [●] [S] [●] [✉ 9] [🔊] [tray] [⏻] [🇮🇹] - DP-1 [1..8] [ open windows ] + DP-3 [📅 Wed 15/09] [🕑 14:32] [●] [●] [✉ 9] [🔊] [tray] [⏻] [🇮🇹] + DP-1 [1..8] [S] [ open windows ] Each bracket is a pill. Pills group into clusters with gaps between them, so the bars read as a few objects rather than one strip. Hover cross-fades @@ -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 | volume, microphone, presentation mode, language | Runs a script that resolves a state to an icon path. | -| CSS `background-image` | workspaces, clock, launcher | `format-icons` takes text, not paths. | +| `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. | The consequence worth knowing: **the workspace icons live in `styles/modules.css`, not in the module config.** Changing one means editing @@ -67,21 +67,24 @@ 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 two icons this repo ships are the exception, because the icon theme has -neither. `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 two flags keep -their national colours. +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. + +`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 +stock bar showed: not a flag, and deliberately so. ## Layout | Bar | Cluster | Modules | | --- | --- | --- | | DP-3 | left | date, time, VM dots | -| DP-3 | centre | launcher | | DP-3 | right | privacy dots, mail, volume drawer, tray, presentation mode, language | | DP-1 | left | workspaces | +| DP-1 | centre | launcher | | DP-1 | right | open windows | No battery, temperature, CPU, memory or backlight: this is a desktop. @@ -23,11 +23,11 @@ pointed at DP-3. ## Layout - DP-3 [📅 Wed 15/09] [🕑 14:32] [●] [S] [●] [✉ 9] [🔊] [tray] [⏻] [🇮🇹] - date time vm launcher priv mail vol tray present lang + DP-3 [📅 Wed 15/09] [🕑 14:32] [●] [●] [✉ 9] [🔊] [tray] [⏻] [🇮🇹] + date time vm priv mail vol tray present lang - DP-1 [1..8] [ open windows ] - workspaces taskbar + DP-1 [1..8] [S] [ open windows ] + workspaces launcher taskbar DP-3 is rotated, so a bar there is only 1080px wide. One bar holding every module was too crowded at that width, so status stays on DP-3 alone and the @@ -47,7 +47,7 @@ transparent gaps, so the bar reads as groups rather than a continuous strip. | Position | Module | Icon source | Notes | | --- | --- | --- | --- | -| left | `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 | `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. | | 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. | @@ -57,7 +57,7 @@ transparent gaps, so the bar reads as groups rather than a continuous strip. | right | `tray` | application-provided | | | right | `custom/mail` | CSS, plus the count as text | Unread mail, the same notmuch watcher the stock bar ran. The envelope is a CSS background; the count stays text, because it is content rather than decoration, exactly like the clock. | | right | `custom/presentation` | CSS, keyed on the module's class | Presentation mode, the same `statusctl`-backed module the stock bar ran. It already emits an empty text and a state class, so the icon is chosen in CSS and the glyphs are simply dropped. | -| right | `image#lang` | `flag-it.svg` / `flag-gb.svg`, shipped here | An `image` module: `hyprland/language` styles as `#language` only, with no per-language class, so a flag cannot be selected in CSS. | +| right | `image#lang` | `flag-it.svg` / `burger.svg`, shipped here | An `image` module: `hyprland/language` styles as `#language` only, with no per-language class, so the image cannot be selected in CSS. English gets the hamburger the stock bar showed, not a flag. | Dropped from the current bar: `custom/breaktimer`, `custom/mail`, `custom/privacy_dots` stays only if you want it on this bar too (it is @@ -152,7 +152,7 @@ Modular, one file per module, mirroring the current setup: icons/ slackware.svg carries @ACCENT@, substituted on install flag-it.svg - flag-gb.svg + burger.svg bin/ wb-icon state to icon path, for the `image` modules vms_dots.sh moved here from ~/bin, symlinked back @@ -169,24 +169,30 @@ module file explicitly. That is a waybar limitation, not a choice. This repo is a **consumer** of udt: it holds the bar, udt holds the colours. `styles/theme.css` is generated by `udt-palette` and gitignored, exactly like -every other generated file in that repo. Generating it needs two changes on -the udt side: - -**A new `[waybar]` role block.** The current one names `temperature`, -`memory`, `cpu`, `backlight` and `battery`, none of which exist on this bar. -The new roles are `launcher`, `workspaces`, `vmdots`, `taskbar`, `volume`, -`tray`, `present`, `lang`, `date`, `time`, plus the existing `main_*`, -`hover_*` and `outline`. - -**Added to all nine `roles-*.conf`.** `udt-palette --selftest` enforces that -every scheme defines the same role set, so a role added to one file and not -the rest fails the check. That is the check doing its job. - -Dot colours come from the existing `[state]` roles: `success` for a running -VM, `warning` for paused, `critical` for crashed, `info` for saved, and -`fg_faint` for shut off. Both dot scripts currently hardcode `#30D158`, -`#FFD60A`, `#FF9F0A`, `#9B32FA` and `#6E6E73`; they will read a generated -colour block instead. +every other generated file in that repo. udt's `install.sh` writes it straight +into `~/.config/waybar-udt/styles/theme.css` under a fixed name this bar +imports, so switching scheme rewrites the file the running bar already reads. + +**The `[waybar]` role block has no per-module colours.** This was planned as a +rename, and turned out to be a deletion. The stock bar alternated module +backgrounds so it read as stripes, and carried a role for each: `workspaces`, +`temperature`, `memory`, `cpu`, `time`, `date`, `tray`, `volume`, `backlight`, +`battery`, plus `charging`. This bar draws every pill on `@main-bg`, and its +stylesheets reference seven names in total: + + @accent @main-bg @main-fg @hover-bg @hover-fg @outline @critical + +So all eleven module roles had no consumer, and adding `launcher`, `mail` or +`present` roles would have invented more of the same. They are gone from all +nine `roles-*.conf` and from `gen_waybar`. Re-adding one means a stylesheet +that actually references it. + +**Dot colours do not come from `[state]`.** `gen_waybar` never emitted +`success` or `info`, so `install.sh` reads `green`, `teal`, `mauve`, +`overlay0`, `warning` and `critical` back out of the generated stylesheet and +writes `~/.config/waybar-udt/dots.colors` for the two scripts to source. They +are bash and cannot read `@define-color`; both fall back to Macchiato values +when that file is missing, so they still run standalone. ## Install diff --git a/bin/wb-lang b/bin/wb-lang index 5a0cd5d..4e846b6 100755 --- a/bin/wb-lang +++ b/bin/wb-lang @@ -10,8 +10,8 @@ # # wb-lang # print "$path\n$tooltip" for the image module # -# The flags live next to this bar's config because the icon theme ships 13 and -# neither Italian nor British is among them. +# The images live next to this bar's config: the icon theme ships 13 flags and +# Italian is not among them, and it has no hamburger at all. set -euo pipefail flags="$HOME/.config/waybar-udt" @@ -30,11 +30,14 @@ for k in d.get("keyboards", []): print(k.get("active_keymap", "")) break' 2>/dev/null || true)" +# Italian gets its flag; English gets the hamburger, which is what the stock +# bar showed for it. Not a national flag on purpose: the layout is "us" but +# the joke predates this bar, so restoring it matters more than consistency. case "$layout" in Italian*) flag="flag-it.svg"; name="Italian" ;; -English*) flag="flag-gb.svg"; name="English" ;; +English*) flag="burger.svg"; name="English" ;; "") flag="flag-it.svg"; name="unknown" ;; -*) flag="flag-gb.svg"; name="$layout" ;; +*) flag="burger.svg"; name="$layout" ;; esac if [[ ! -r "$flags/$flag" ]]; then diff --git a/config.jsonc b/config.jsonc index 1d94a39..58944aa 100644 --- a/config.jsonc +++ b/config.jsonc @@ -16,7 +16,6 @@ "include": [ "$HOME/.config/waybar-udt/modules/clock.jsonc", "$HOME/.config/waybar-udt/modules/custom/vmdot.jsonc", - "$HOME/.config/waybar-udt/modules/image/launcher.jsonc", "$HOME/.config/waybar-udt/modules/custom/privacy_dots.jsonc", "$HOME/.config/waybar-udt/modules/custom/mail.jsonc", "$HOME/.config/waybar-udt/modules/image/volume.jsonc", @@ -30,9 +29,6 @@ "clock#time", "custom/vmdot" ], - "modules-center": [ - "image#launcher" - ], "modules-right": [ "custom/privacy_dots", "custom/mail", @@ -55,12 +51,16 @@ { "include": [ "$HOME/.config/waybar-udt/modules/hyprland/workspaces.jsonc", + "$HOME/.config/waybar-udt/modules/image/launcher.jsonc", "$HOME/.config/waybar-udt/modules/extras/taskbar.jsonc", ], "modules-left": [ "hyprland/workspaces" ], + "modules-center": [ + "image#launcher" + ], "modules-right": [ "wlr/taskbar" ], diff --git a/icons/burger.svg b/icons/burger.svg new file mode 100644 index 0000000..a424979 --- /dev/null +++ b/icons/burger.svg @@ -0,0 +1,10 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"> + <!-- Hamburger, from Twemoji (CC-BY 4.0, twitter/twemoji). + Stands in for the English keyboard layout, restoring the emoji the + stock bar used. It is an image rather than an emoji glyph because the + language module takes a path, not text. + + The root <svg> 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 makes every consumer report an unrecognised format on + perfectly valid XML. --><path fill="#D99E82" d="M18 20.411c-9.371 0-16.967-.225-16.967 6.427C1.033 33.487 8.629 35 18 35c9.371 0 16.967-1.513 16.967-8.162 0-6.651-7.596-6.427-16.967-6.427z"/><path fill="#662113" d="M34.47 20.916S26.251 19.932 18 19.89c-8.251.042-16.47 1.026-16.47 1.026C.717 27.39 7.467 30.057 18 30.057s17.283-2.667 16.47-9.141z"/><path fill="#FFCC4D" d="m33.886 18.328-31.855.646c-1.1 0-2.021 2.229-.854 2.812 8.708 2.708 15.708 5.448 15.708 5.448.962.532 1.287.534 2.25.003 0 0 9.666-3.868 15.875-5.493.881-.23-.025-3.416-1.124-3.416z"/><path fill="#77B255" d="M34.725 18.412c-1.9-1.751-1.79-.819-3.246-1.23-.553-.156-4.51-5.271-13.529-5.271h-.02c-9.019 0-12.976 5.115-13.529 5.271-1.456.411-1.346-.521-3.246 1.23-.872.804-1.108 1.222-.188 1.43 1.386.313 1.26 1.152 2.253 1.444 1.202.353 1.696-.292 3.634-.028 1.653.225 1.761 2.369 3.429 2.369s1.668-.8 3.335-.8 2.653 2.146 4.321 2.146 2.653-2.146 4.321-2.146c1.668 0 1.668.8 3.335.8 1.668 0 1.776-2.144 3.429-2.369 1.938-.263 2.433.381 3.634.028.993-.292.867-1.13 2.253-1.444.922-.207.687-.626-.186-1.43z"/><path fill="#DD2E44" d="M34.077 16.52c0 2.984-7.198 4.393-16.077 4.393S1.923 19.504 1.923 16.52c0-5.403.966-5.403 16.077-5.403s16.077.001 16.077 5.403z"/><path fill="#D99E82" d="M18 .524C8.629.524 1.033 4.915 1.033 11.566c0 6.125 7.596 6.375 16.967 6.375s16.967-.25 16.967-6.375C34.967 4.914 27.371.524 18 .524z"/><path fill="#FFE8B6" d="M10.784 3.695a1.069 1.069 0 1 0-1.152 1.802c.498.319 1.76.557 2.079.059.318-.498-.429-1.543-.927-1.861zm9.734-1.035c-.562.182-1.549 1.006-1.366 1.568.183.562 1.464.648 2.026.466a1.069 1.069 0 0 0-.66-2.034zm10.909 7.035c-.452-.38-1.585.225-1.966.677a1.07 1.07 0 0 0 1.638 1.376c.381-.453.781-1.673.328-2.053zm-3.643-5a1.07 1.07 0 0 0-1.152 1.803c.498.319 1.76.557 2.078.059.319-.499-.428-1.544-.926-1.862zm-15 7a1.07 1.07 0 0 0-1.478.326 1.068 1.068 0 0 0 .326 1.476c.498.319 1.76.558 2.078.059.319-.498-.428-1.543-.926-1.861zm3.046-4.808c-.336.486-.62 1.739-.133 2.075.486.336 1.557-.374 1.893-.86a1.07 1.07 0 0 0-1.76-1.215zm7.954 4.808a1.07 1.07 0 0 0-1.478.326 1.068 1.068 0 0 0 .326 1.476c.498.319 1.76.558 2.078.059.319-.498-.428-1.543-.926-1.861zM4.948 7.808c-.394.441-.833 1.648-.392 2.042.439.394 1.591-.174 1.985-.615a1.07 1.07 0 1 0-1.593-1.427z"/></svg> diff --git a/icons/flag-gb.svg b/icons/flag-gb.svg deleted file mode 100644 index 7991383..0000000 --- a/icons/flag-gb.svg +++ /dev/null @@ -1,7 +0,0 @@ -<svg xmlns="http://www.w3.org/2000/svg" id="flag-icons-gb" viewBox="0 0 640 480"> - <path fill="#012169" d="M0 0h640v480H0z"/> - <path fill="#FFF" d="m75 0 244 181L562 0h78v62L400 241l240 178v61h-80L320 301 81 480H0v-60l239-178L0 64V0z"/> - <path fill="#C8102E" d="m424 281 216 159v40L369 281zm-184 20 6 35L54 480H0zM640 0v3L391 191l2-44L590 0zM0 0l239 176h-60L0 42z"/> - <path fill="#FFF" d="M241 0v480h160V0zM0 160v160h640V160z"/> - <path fill="#C8102E" d="M0 193v96h640v-96zM273 0v480h96V0z"/> -</svg> @@ -125,7 +125,10 @@ mark="$(sed -n 's/^@define-color main-bg *\(.*\);$/\1/p' "$target/styles/theme.c mark="${mark:-#24273a}" sed "s|@ACCENT@|$mark|" "$repo/icons/slackware.svg" > "$target/slackware.svg" install -Dm644 "$repo/icons/flag-it.svg" "$target/flag-it.svg" -install -Dm644 "$repo/icons/flag-gb.svg" "$target/flag-gb.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" # ---------------------------------------------------------------- scripts -- # The two dot scripts used to live only in ~/bin, in no repository at all. |
