Some checks failed
Check / eval (push) Has been cancelled
The machine flake's git-tracked settings file is system state, not "theme" only — rename it to state.json. CLI becomes nomarchy-state-sync with a nomarchy-theme-sync symlink for scripts and muscle memory. Eval (mkFlake, doctor, lifecycle) still accepts theme-state.json; the next write migrates to state.json and removes the legacy file. Documented in MIGRATION.md; drop the CLI alias after release notes.
56 lines
1.5 KiB
Nix
56 lines
1.5 KiB
Nix
# swayosd — on-screen display for volume / brightness / mute (and caps
|
|
# lock). The media keys drive it via swayosd-client (it performs the
|
|
# action AND shows the OSD), so changing volume or brightness gives the
|
|
# visual feedback that bare wpctl/brightnessctl didn't. Themed from
|
|
# state.json. Brightness needs the backlight udev rule shipped
|
|
# system-side (modules/nixos/default.nix → services.udev.packages).
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
cfg = config.nomarchy;
|
|
t = cfg.theme;
|
|
c = t.colors;
|
|
|
|
style = pkgs.writeText "swayosd-style.css" ''
|
|
window#osd {
|
|
border-radius: ${toString t.ui.rounding}px;
|
|
border: ${toString t.ui.borderSize}px solid ${c.accent};
|
|
background: alpha(${c.base}, 0.92);
|
|
}
|
|
window#osd #container { margin: 16px; }
|
|
window#osd image,
|
|
window#osd label { color: ${c.text}; }
|
|
window#osd progressbar:disabled,
|
|
window#osd image:disabled { opacity: 0.5; }
|
|
window#osd progressbar,
|
|
window#osd segmentedprogress {
|
|
min-height: 8px;
|
|
border-radius: 999px;
|
|
background: transparent;
|
|
border: none;
|
|
}
|
|
window#osd trough,
|
|
window#osd segment {
|
|
min-height: inherit;
|
|
border-radius: inherit;
|
|
border: none;
|
|
background: ${c.surface};
|
|
}
|
|
window#osd progress,
|
|
window#osd segment.active {
|
|
min-height: inherit;
|
|
border-radius: inherit;
|
|
border: none;
|
|
background: ${c.accent};
|
|
}
|
|
'';
|
|
in
|
|
{
|
|
config = lib.mkIf cfg.osd.enable {
|
|
services.swayosd = {
|
|
enable = true;
|
|
stylePath = style;
|
|
};
|
|
};
|
|
}
|