diff --git a/settings/hyprland.nix b/settings/hyprland.nix index 8ea8716..6f485a2 100644 --- a/settings/hyprland.nix +++ b/settings/hyprland.nix @@ -206,6 +206,13 @@ in extraConfig = let + # hyprpaper 0.8.4 bug: wallpaper= in config is silently ignored. + # preload= works; set the wallpaper via IPC after startup. + setWallpaper = pkgs.writeShellScript "set-hyprpaper-wallpaper" '' + sleep 2 + wallpaper=$(grep '^preload=' "$HOME/.config/hypr/hyprpaper.conf" | head -1 | cut -d= -f2-) + ${hyprland-pkgs.hyprland}/bin/hyprctl hyprpaper wallpaper "${if isGaming then "DP-2" else "eDP-1"},$wallpaper" + ''; powerMenu = pkgs.writeShellScript "power-menu" '' choice=$(printf '%s\n' \ $'\uf023 Lock' \ @@ -268,11 +275,7 @@ in hl.exec_cmd("hyprctl setcursor Bibata-Modern-Ice 24") hl.exec_cmd("swayosd-server") ${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-)") + hl.exec_cmd("${setWallpaper}") end) -- Animation curve and definitions