diff --git a/profiles/powerManagement.nix b/profiles/powerManagement.nix index 5993529..2b70da7 100644 --- a/profiles/powerManagement.nix +++ b/profiles/powerManagement.nix @@ -15,6 +15,12 @@ logind = { lidSwitch = "suspend-then-hibernate"; lidSwitchDocked = "ignore"; + # powerKey = "suspend-then-hibernate"; # Enable in 23.11 + extraConfig = '' + HandlePowerKey=suspend-then-hibernate + IdleAction=suspend-then-hibernate + IdleActionSec=10m + ''; }; thermald.enable = true; auto-cpufreq = { @@ -37,4 +43,14 @@ 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" + ]; + }; }