Files
hyprcosmic/config/waybar/style.css
T
gitops e46514cbab Install HyDE themes end to end
Three things stood between `assets.rs` and a themed desktop.

`import-theme` never called it. The module was written, tested and unreachable;
`--assets` now wires it up, with `--source`, `--overwrite` and `--dry-run`, and
finds the theme repo's Source/ directory by searching upward rather than
assuming HyDE's exact nesting depth.

The archive guard rejected every real icon theme. Refusing any `..` in a link
target is right for an entry path but wrong for a symlink: icon themes are
built out of relative links into sibling directories, and Tela ships thousands
of `../devices/network-wireless.svg`. What matters is whether the target
resolves inside the destination, which `stays_within_root` now decides
lexically -- no canonicalize, since the tree does not exist at plan time and
following real links during validation would be a TOCTOU window. Absolute
targets and links that climb past the root are still refused; the existing
escape tests still pass.

`apply` silently ignored `source`. It parsed and resolved inline while `watch`
went through `compile`, and `flatten` drops `Item::Source` -- so an include
that worked under `watch` vanished under `apply`. `apply` now uses `compile`
too. This matters immediately: the generated theme lives in its own
theme.conf, sourced from cosmic.conf, so re-importing a theme cannot clobber
the keybindings.

The waybar stylesheet claimed a theme could be dropped in ahead of it to
recolour the bar. It could not -- HyDE names its colours main-bg/wb-act-bg and
the rules referenced bar-bg/accent. Split into palette + theme + bridge +
rules, imported in that order, so the claim is now true. Verified by loading
the result through GTK's own CSS parser: with Tokyo Night installed main-bg
resolves to #24283b and wb-act-bg to #bb9af7; with an empty theme.css the
defaults stand. Both parse without error.

Two deliberate departures, both commented where they are made: the theme's
near-transparent bar-bg is composited at 0.85 because cosmic-comp has no blur
to put behind it, and theme.css is copied next to style.css rather than
imported from HyDE's own path, because a missing @import is fatal in GTK and
would break the bar on any machine without a theme.
2026-08-10 09:11:08 +07:00

33 lines
1.6 KiB
CSS

/* Waybar styling for a HyprCosmic session.
*
* This file is only an import list, because the order is the whole design:
*
* 1. palette.css default colours, under both our names and HyDE's
* 2. theme.css the installed HyDE theme's waybar.theme, if any
* 3. bridge-hyde.css maps HyDE's colour names onto the ones the rules use
* 4. rules.css geometry and layout; no colour literals at all
*
* Every entry is an @import, so they are read strictly in sequence and a later
* definition of a colour wins over an earlier one. That is what lets step 2
* recolour the bar without step 4 knowing a theme exists.
*
* Step 2 is a copy of the installed theme's waybar.theme, kept as a sibling of
* this file rather than read from HyDE's own ~/.config/waybar/theme.css.
*
* That copy exists because a missing @import is fatal in GTK, not a warning:
* pointing at HyDE's path directly means the whole stylesheet fails to load on
* any machine where no theme has been imported. A sibling file we create at
* install time is always present -- empty when there is no theme, in which
* case the defaults from step 1 stand. palette.css defines HyDE's names too,
* so the bridge in step 3 resolves either way.
*
* Consequently this file belongs at ~/.config/hyprcosmic/waybar/style.css, not
* under /usr/share: a relative @import resolves against the importing file,
* and theme.css is per-user.
*/
@import url("file:///usr/share/hyprcosmic/waybar/palette.css");
@import url("theme.css");
@import url("file:///usr/share/hyprcosmic/waybar/bridge-hyde.css");
@import url("file:///usr/share/hyprcosmic/waybar/rules.css");