diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index ba8d6fb..1b9e596 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -58,6 +58,7 @@ pkgs.alejandra pkgs.dconf pkgs.wl-clipboard + pkgs.swaybg # # You can also create simple shell scripts directly inside your # # configuration. For example, this adds a command 'my-hello' to your diff --git a/modules/rice/hyprland/default.nix b/modules/rice/hyprland/default.nix index 6065a5a..099987e 100644 --- a/modules/rice/hyprland/default.nix +++ b/modules/rice/hyprland/default.nix @@ -2,8 +2,16 @@ pkgs, lib, inputs, + theme, ... -}: { +}: +with lib; let + mkService = lib.recursiveUpdate { + Unit.PartOf = ["graphical-session.target"]; + Unit.After = ["graphical-session.target"]; + Install.WantedBy = ["graphical-session.target"]; + }; +in { imports = [./config.nix ./binds.nix]; wayland.windowManager.hyprland = { enable = true; @@ -16,4 +24,14 @@ ]; }; }; + + systemd.user.services = { + swaybg = mkService { + Unit.Description = "Wallpaper chooser"; + Service = { + ExecStart = "${lib.getExe pkgs.swaybg} -i ${theme.wallpaper}"; + Restart = "always"; + }; + }; + }; }