hyprland: load the live theme at the end of the config so a reload keeps it

This commit is contained in:
rope 2026-08-19 17:33:40 +01:00
parent d40b3e518f
commit c87b40d528

View file

@ -548,6 +548,22 @@ in
hl.bind("XF86AudioPlay", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true }) 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("XF86AudioNext", hl.dsp.exec_cmd("playerctl next"), { locked = true })
hl.bind("XF86AudioPrev", hl.dsp.exec_cmd("playerctl previous"), { 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")
''; '';
}; };