From 4ec35cd3bbd10413f2e8b73e9ab1970c28691bec Mon Sep 17 00:00:00 2001 From: Craige McWhirter Date: Wed, 22 May 2024 21:56:57 +1000 Subject: [PATCH] powerManagement: configure power button and screenlock --- profiles/powerManagement.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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" + ]; + }; }