modifié : DELL/nixpkgs/home.nix

modifié :         DELL/nixpkgs/variables.nix
	nouveau fichier : DELL/nixpkgs/xidlehook.nix
This commit is contained in:
Alexandre LUCAZEAU 2022-05-24 20:57:18 +02:00
parent 2bae059f01
commit daa325a425
No known key found for this signature in database
GPG Key ID: 3C8ADB07A8217BD3
3 changed files with 29 additions and 0 deletions

View File

@ -18,4 +18,5 @@
xdg.configFile = {
"i3/config".source = ./configs/i3config;
};
xsession.numlock.enable = true;
}

View File

@ -7,6 +7,7 @@
TERMINAL = "xfce4-terminal";
BROWSER = "firefox";
PRIVATE_BROWSER = "firefox -private";
default-web-browser = "firefox";
# };
};
}

View File

@ -0,0 +1,27 @@
{ 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 = "${pkgs.writeShellScript "my-script" ''
xrandr --output "$PRIMARY_DISPLAY" --brightness 1
systemctl suspend
''}";
}
];
};
}