From 64c7fae9745df104da87069325b97c8d314ea84d Mon Sep 17 00:00:00 2001 From: Mikael Voss Date: Mon, 16 Sep 2024 20:25:01 +0200 Subject: [PATCH] niri: Power off monitors via DPMS --- home/config/nil/desktop.nix | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/home/config/nil/desktop.nix b/home/config/nil/desktop.nix index 1819b70..865c72e 100644 --- a/home/config/nil/desktop.nix +++ b/home/config/nil/desktop.nix @@ -8,29 +8,13 @@ let fuzzel = lib.getExe config.programs.fuzzel.package; kitty = lib.getExe config.programs.kitty.package; loginctl = osConfig.systemd.package + /bin/loginctl; + niri = lib.getExe config.programs.niri.package; playerctl = config.services.playerctld.package + /bin/playerctl; swaylock = lib.getExe config.programs.swaylock.package; systemctl = osConfig.systemd.package + /bin/systemctl; wpctl = osConfig.services.pipewire.wireplumber.package + /bin/wpctl; xdg-open = pkgs.xdg-utils + /bin/xdg-open; - niri-each-output = let - pkg = pkgs.writeShellApplication { - name = "niri-each-output"; - runtimeInputs = [ - config.programs.niri.package - pkgs.findutils - pkgs.jq - ]; - - text = '' - niri msg --json outputs \ - | jq --raw-output0 '. | keys | .[]' \ - | xargs -0 I {} -- niri msg output {} "$1" - ''; - }; - in lib.getExe pkg; - askpass = let pkg = pkgs.writeShellApplication { name = "fuzzel-askpass"; @@ -338,8 +322,7 @@ in lib.mkIf (osConfig.hardware.graphics.enable or false) { } { timeout = 270; - command = "${niri-each-output} off"; - resumeCommand = "${niri-each-output} on"; + command = "${niri} msg action power-off-monitors"; } ]; };