From 0716de42455fcf756c74c3d2ae22ddf710434f19 Mon Sep 17 00:00:00 2001 From: Myned Date: Thu, 26 Dec 2024 19:09:59 -0500 Subject: [PATCH] niri: add startup commands Signed-off-by: Myned --- options/custom/desktops/niri/misc.nix | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/options/custom/desktops/niri/misc.nix b/options/custom/desktops/niri/misc.nix index df6ccc6..097a636 100644 --- a/options/custom/desktops/niri/misc.nix +++ b/options/custom/desktops/niri/misc.nix @@ -5,8 +5,12 @@ ... }: with lib; let + _1password = "${config.programs._1password-gui.package}/bin/1password"; + audio = config.home-manager.users.${config.custom.username}.home.file.".local/bin/audio".source; niri = "${config.programs.niri.package}/bin/niri"; + rm = "${pkgs.coreutils}/bin/rm"; sway-audio-idle-inhibit = "${pkgs.sway-audio-idle-inhibit}/bin/sway-audio-idle-inhibit"; + wallpaper = "${config.home-manager.users.${config.custom.username}.home.file.".local/bin/wallpaper".source}"; cfg = config.custom.desktops.niri.misc; in { @@ -19,8 +23,19 @@ in { programs.niri.settings = { # https://github.com/YaLTeR/niri/wiki/Configuration:-Miscellaneous - spawn-at-startup = [ + # https://github.com/YaLTeR/niri/wiki/Configuration:-Miscellaneous#spawn-at-startup + # https://github.com/YaLTeR/niri/wiki/Configuration:-Key-Bindings#actions + spawn-at-startup = let + home = config.home-manager.users.${config.custom.username}.home.homeDirectory; + in + [ + {command = [_1password "--silent"];} # Launch password manager in background + {command = [audio "--init"];} # Enforce audio profile state + {command = [rm "${home}/.cache/walker/clipboard.gob"];} # Clear clipboard history {command = [sway-audio-idle-inhibit];} # Inhibit while audio is playing + ] + ++ optionals config.custom.wallpaper [ + {command = [wallpaper];} ]; # HACK: Inherit home-manager environment variables in lieu of upstream fix