From 2cc0d08c0468e678fb7a942abf23fc2a1eec010f Mon Sep 17 00:00:00 2001 From: Miran Bastaja Date: Fri, 4 Jul 2025 15:55:45 +0200 Subject: niri: configure wallpaper switching --- share/home/niri.nix | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'share/home/niri.nix') diff --git a/share/home/niri.nix b/share/home/niri.nix index 450a3e4..eb5822d 100644 --- a/share/home/niri.nix +++ b/share/home/niri.nix @@ -2,8 +2,14 @@ pkgs, config, inputs, + lib, ... }: +let + cfg = config.programs.niri; + tomlFormat = pkgs.formats.toml { }; + inherit (lib) mkIf; +in { imports = [ inputs.niri-flake.homeModules.niri @@ -11,6 +17,9 @@ programs.waybar.enable = true; programs.tofi.enable = true; programs.kitty.enable = true; + home.packages = [ + pkgs.wpaperd # for wpaperctl + ]; programs.niri.settings = { input = { @@ -64,6 +73,7 @@ spawn-at-startup = [ { command = [ "${pkgs.xwayland-satellite}/bin/xwayland-satellite" ]; } { command = [ "${pkgs.mako}/bin/mako" ]; } + { command = [ "${pkgs.wpaperd}/bin/wpaperd" ]; } ]; environment = { @@ -233,4 +243,19 @@ "Ctrl+Alt+Delete".action = quit; }; }; + + # wpaperd manual config + # + # Can't use the HM module since it doesn't expose the service target as a + # config option. If I enabled it, wpaperd would be started for every DE, which + # I don't want. + xdg.configFile."wpaperd/wallpaper.toml" = { + source = tomlFormat.generate "wpaperd-wallpaper" { + default = { + path = "${config.xdg.userDirs.pictures}/Wallpapers"; + duration = "10m"; + sorting = "random"; + }; + }; + }; } -- cgit v1.3.1