fix xrandr paths

This commit is contained in:
Cyryl Płotnicki 2022-03-20 21:05:06 +00:00
parent 218d88751d
commit 31468ea2d3

View file

@ -4,19 +4,20 @@
not-when-audio = true; not-when-audio = true;
not-when-fullscreen = true; not-when-fullscreen = true;
environment = { environment = {
"PRIMARY_DISPLAY" = "$(${pkgs.xorg.xrandr} | awk '/ primary/{print $1}')"; "PRIMARY_DISPLAY" =
"$(${pkgs.xorg.xrandr}/bin/xrandr | awk '/ primary/{print $1}')";
}; };
timers = [ timers = [
{ {
delay = 60; delay = 60;
command = command = ''
''${pkgs.xorg.xrandr} --output "$PRIMARY_DISPLAY" --brightness .1''; ${pkgs.xorg.xrandr}/bin/xrandr --output "$PRIMARY_DISPLAY" --brightness .1'';
canceller = canceller = ''
''${pkgs.xorg.xrandr} --output "$PRIMARY_DISPLAY" --brightness 1''; ${pkgs.xorg.xrandr}/bin/xrandr --output "$PRIMARY_DISPLAY" --brightness 1'';
} }
{ {
delay = 240; delay = 240;
command = "${pkgs.writeShellScript "my-script" '' command = "${pkgs.writeShellScript "enable-display-and-suspend" ''
${pkgs.xorg.xrandr}/bin/xrandr --output "$PRIMARY_DISPLAY" --brightness 1 ${pkgs.xorg.xrandr}/bin/xrandr --output "$PRIMARY_DISPLAY" --brightness 1
${pkgs.xorg.xrandr}/bin/xrandr --auto ${pkgs.xorg.xrandr}/bin/xrandr --auto
systemctl suspend systemctl suspend