diff --git a/settings/hyprland.nix b/settings/hyprland.nix index 54d9f65..c78cc5d 100644 --- a/settings/hyprland.nix +++ b/settings/hyprland.nix @@ -548,6 +548,22 @@ in hl.bind("XF86AudioPlay", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true }) hl.bind("XF86AudioNext", hl.dsp.exec_cmd("playerctl next"), { locked = true }) hl.bind("XF86AudioPrev", hl.dsp.exec_cmd("playerctl previous"), { locked = true }) + + -- The live theme, last so it beats the build-time colours in + -- settings.config above. A rebuild rewrites this file and hyprland + -- reloads it, which re-runs the whole config — that is why the + -- borders used to snap back to the build-time palette on every + -- `update` and stay there until the next wallpaper switch. + -- theme-apply's `hyprctl eval` only touches the running instance; + -- this is the half that survives a reload. It also means a fresh + -- session starts on the last-used theme rather than stylix's. + -- + -- pcall, not a bare call: before the first theme-apply on a new + -- account the state symlink does not exist, and hyprland opens + -- only selected Lua libraries (luaL_openselectedlibs), so `dofile` + -- itself may be absent. Either way this degrades to a no-op + -- instead of aborting the rest of the config. + pcall(dofile, "${config.xdg.stateHome}/quickshell-theme/hypr.lua") ''; };