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 <noreply@anthropic.com>
This commit is contained in:
parent
e90018d780
commit
542d5b1ee6
1 changed files with 8 additions and 5 deletions
|
|
@ -206,6 +206,13 @@ in
|
||||||
|
|
||||||
extraConfig =
|
extraConfig =
|
||||||
let
|
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" ''
|
powerMenu = pkgs.writeShellScript "power-menu" ''
|
||||||
choice=$(printf '%s\n' \
|
choice=$(printf '%s\n' \
|
||||||
$'\uf023 Lock' \
|
$'\uf023 Lock' \
|
||||||
|
|
@ -268,11 +275,7 @@ 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.
|
hl.exec_cmd("${setWallpaper}")
|
||||||
-- 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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue