From 218d88751d87da242a855970b71db57bbea2d39e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Sun, 20 Mar 2022 20:58:39 +0000 Subject: [PATCH] enable all displays before going to sleep --- nixos/i3/xidlehook.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/nixos/i3/xidlehook.nix b/nixos/i3/xidlehook.nix index 5ac40068..6158c4e2 100644 --- a/nixos/i3/xidlehook.nix +++ b/nixos/i3/xidlehook.nix @@ -4,18 +4,21 @@ not-when-audio = true; not-when-fullscreen = true; environment = { - "PRIMARY_DISPLAY" = "$(xrandr | awk '/ primary/{print $1}')"; + "PRIMARY_DISPLAY" = "$(${pkgs.xorg.xrandr} | awk '/ primary/{print $1}')"; }; timers = [ { delay = 60; - command = ''xrandr --output "$PRIMARY_DISPLAY" --brightness .1''; - canceller = ''xrandr --output "$PRIMARY_DISPLAY" --brightness 1''; + command = + ''${pkgs.xorg.xrandr} --output "$PRIMARY_DISPLAY" --brightness .1''; + canceller = + ''${pkgs.xorg.xrandr} --output "$PRIMARY_DISPLAY" --brightness 1''; } { - delay = 600; + delay = 240; command = "${pkgs.writeShellScript "my-script" '' - xrandr --output "$PRIMARY_DISPLAY" --brightness 1 + ${pkgs.xorg.xrandr}/bin/xrandr --output "$PRIMARY_DISPLAY" --brightness 1 + ${pkgs.xorg.xrandr}/bin/xrandr --auto systemctl suspend ''}"; }