From 542d5b1ee6128a365d163ea4a221494fc3f5cb3c Mon Sep 17 00:00:00 2001 From: rope Date: Mon, 18 May 2026 10:18:15 +0100 Subject: [PATCH] hyprpaper: fix wallpaper IPC script (use writeShellScript) The previous inline shell command had quoting/PATH issues. Replace with a proper pkgs.writeShellScript that: - Uses the full hyprctl store path (no PATH dependency) - Reads the wallpaper from hyprpaper.conf at runtime ($HOME/.config) - Avoids the Nix string-context conflict from embedding a store path Co-Authored-By: Claude Sonnet 4.6 --- settings/hyprland.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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