Add screen dimming and switching off displays on idle
This commit is contained in:
parent
81a4822e2d
commit
b6909c162b
1 changed files with 3 additions and 2 deletions
|
|
@ -245,6 +245,8 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
services.swayidle = let
|
services.swayidle = let
|
||||||
|
dimDuration = 15;
|
||||||
|
dimScreen = "${lib.getExe pkgs.chayang} -d ${toString dimDuration}";
|
||||||
swaylock = "${lib.getExe pkgs.swaylock} -f";
|
swaylock = "${lib.getExe pkgs.swaylock} -f";
|
||||||
switchOutput = "${pkgs.sway}/bin/swaymsg 'output * power'";
|
switchOutput = "${pkgs.sway}/bin/swaymsg 'output * power'";
|
||||||
in {
|
in {
|
||||||
|
|
@ -255,8 +257,7 @@ in {
|
||||||
after-resume = "${switchOutput} on";
|
after-resume = "${switchOutput} on";
|
||||||
};
|
};
|
||||||
timeouts = [
|
timeouts = [
|
||||||
{ timeout = 300; command = "${switchOutput} off"; }
|
{ timeout = 300; command = "${dimScreen} && ${switchOutput} off && ${swaylock}"; resumeCommand = "${switchOutput} on"; }
|
||||||
{ timeout = 330; command = swaylock; }
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue