Use swaybg to change the background

This commit is contained in:
Nina Chlóe Kassandra Reiß
2026-06-19 09:06:56 +02:00
parent 7cff4d2f2e
commit 82f6f840a5
3 changed files with 19 additions and 2 deletions
+3
View File
@@ -0,0 +1,3 @@
hl.on("hyprland.start", function()
hl.exec_cmd("swaybg -m stretch -i ./wallpaper/XP.jpg")
end)
+15 -2
View File
@@ -13,13 +13,23 @@
}; };
hypr = pkgs.hyprland; hypr = pkgs.hyprland;
configFile = "${self}/hyprland.lua";
configDir = pkgs.lib.cleanSource ./.;
configFile = "${configDir}/hyprland.lua";
runtimePackages = with pkgs; [
swaybg
];
runtimePath = pkgs.lib.makeBinPath runtimePackages;
verifyScript = pkgs.writeShellScript "hyprland-verify" '' verifyScript = pkgs.writeShellScript "hyprland-verify" ''
export PATH=${runtimePath}:$PATH
exec ${hypr}/bin/Hyprland --config ${configFile} --verify-config exec ${hypr}/bin/Hyprland --config ${configFile} --verify-config
''; '';
runScript = pkgs.writeShellScript "hyprland-run" '' runScript = pkgs.writeShellScript "hyprland-run" ''
export PATH=${runtimePath}:$PATH
exec ${hypr}/bin/Hyprland --config ${configFile} exec ${hypr}/bin/Hyprland --config ${configFile}
''; '';
in in
@@ -36,6 +46,9 @@
}; };
}; };
packages.${system}.default = hypr; packages.${system}.default = pkgs.runCommand "hyprland-config-check" { } ''
${verifyScript}
touch $out
'';
}; };
} }
+1
View File
@@ -1 +1,2 @@
require("monitor") require("monitor")
require("background")