24 lines
567 B
Nix
24 lines
567 B
Nix
|
{ config, pkgs, ... }:
|
||
|
{
|
||
|
services.xidlehook = {
|
||
|
enable = true;
|
||
|
not-when-audio = true;
|
||
|
not-when-fullscreen = true;
|
||
|
environment = {
|
||
|
"PRIMARY_DISPLAY" = "$(xrandr | awk '/ primary/{print $1}')";
|
||
|
};
|
||
|
timers = [
|
||
|
{
|
||
|
delay = 60;
|
||
|
command = "xrandr --output \"$PRIMARY_DISPLAY\" --brightness .1";
|
||
|
canceller = "xrandr --output \"$PRIMARY_DISPLAY\" --brightness 1";
|
||
|
}
|
||
|
{
|
||
|
delay = 600;
|
||
|
command = "xrandr --output \"$PRIMARY_DISPLAY\" --brightness 1; systemctl suspend";
|
||
|
}
|
||
|
];
|
||
|
|
||
|
};
|
||
|
}
|