powerManagement: configure power button and screenlock

This commit is contained in:
Serĉanto de Scio 2024-05-22 21:56:57 +10:00
parent 4e59145aed
commit 4ec35cd3bb
Signed by: sercanto
GPG key ID: A4122FF3971B6865

View file

@ -15,6 +15,12 @@
logind = { logind = {
lidSwitch = "suspend-then-hibernate"; lidSwitch = "suspend-then-hibernate";
lidSwitchDocked = "ignore"; lidSwitchDocked = "ignore";
# powerKey = "suspend-then-hibernate"; # Enable in 23.11
extraConfig = ''
HandlePowerKey=suspend-then-hibernate
IdleAction=suspend-then-hibernate
IdleActionSec=10m
'';
}; };
thermald.enable = true; thermald.enable = true;
auto-cpufreq = { auto-cpufreq = {
@ -37,4 +43,14 @@
criticalPowerAction = "Hibernate"; criticalPowerAction = "Hibernate";
}; };
}; };
programs.xss-lock = {
enable = true;
lockerCommand = "${pkgs.xscreensaver}/bin/screensaver-command -lock";
extraOptions = [
"-n ${pkgs.libnotify}/bin/notify-send \"Locking screen now\""
"IdleAction=lock"
"IdleActionSec=5m"
];
};
} }