From 82f6f840a509039517a102baa6668308e14842a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Chl=C3=B3e=20Kassandra=20Rei=C3=9F?= Date: Fri, 19 Jun 2026 09:06:56 +0200 Subject: [PATCH] Use swaybg to change the background --- background.lua | 3 +++ flake.nix | 17 +++++++++++++++-- hyprland.lua | 1 + 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 background.lua diff --git a/background.lua b/background.lua new file mode 100644 index 0000000..2e2149d --- /dev/null +++ b/background.lua @@ -0,0 +1,3 @@ +hl.on("hyprland.start", function() + hl.exec_cmd("swaybg -m stretch -i ./wallpaper/XP.jpg") +end) diff --git a/flake.nix b/flake.nix index 9c0f505..6de51b7 100644 --- a/flake.nix +++ b/flake.nix @@ -13,13 +13,23 @@ }; 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" '' + export PATH=${runtimePath}:$PATH exec ${hypr}/bin/Hyprland --config ${configFile} --verify-config ''; runScript = pkgs.writeShellScript "hyprland-run" '' + export PATH=${runtimePath}:$PATH exec ${hypr}/bin/Hyprland --config ${configFile} ''; in @@ -36,6 +46,9 @@ }; }; - packages.${system}.default = hypr; + packages.${system}.default = pkgs.runCommand "hyprland-config-check" { } '' + ${verifyScript} + touch $out + ''; }; } diff --git a/hyprland.lua b/hyprland.lua index e712f6f..61eef48 100644 --- a/hyprland.lua +++ b/hyprland.lua @@ -1 +1,2 @@ require("monitor") +require("background")