hyprpaper: work around 0.8.4 wallpaper= config bug via IPC

hyprpaper 0.8.4 silently ignores wallpaper= directives in the config
on startup — preload= works but the monitor assignment does not.

Add a hyprland.start hook that waits 2s (for hyprpaper to preload the
image) then sets the wallpaper via hyprctl IPC.  The image path is read
at runtime from hyprpaper.conf to avoid a Nix string-context conflict
between the stylix image store path and the powerMenu derivation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
rope 2026-05-18 10:13:36 +01:00
parent 4fa6dc9f88
commit e90018d780

View file

@ -268,6 +268,11 @@ in
hl.exec_cmd("hyprctl setcursor Bibata-Modern-Ice 24") hl.exec_cmd("hyprctl setcursor Bibata-Modern-Ice 24")
hl.exec_cmd("swayosd-server") hl.exec_cmd("swayosd-server")
${lib.optionalString isMacbook ''hl.exec_cmd("hypridle")''} ${lib.optionalString isMacbook ''hl.exec_cmd("hypridle")''}
-- hyprpaper 0.8.4 bug: wallpaper= in config is ignored on startup.
-- preload= works so the image is ready; use IPC to assign it.
-- Read the path from hyprpaper.conf at runtime to avoid Nix
-- string-context conflicts with the powerMenu derivation above.
hl.exec_cmd("sleep 2 && hyprctl hyprpaper wallpaper '${if isGaming then "DP-2" else "eDP-1"},'$(grep '^preload=' \"$XDG_CONFIG_HOME/hypr/hyprpaper.conf\" | head -1 | cut -d= -f2-)")
end) end)
-- Animation curve and definitions -- Animation curve and definitions