From dc8fe5c7d95076b168bf63410c92cfd812c39d29 Mon Sep 17 00:00:00 2001 From: Frantisek Bohacek Date: Sat, 4 May 2024 12:15:36 +0200 Subject: [PATCH] fix: do not suspend when GUI quits --- nixos/hosts/laptop-phobos/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nixos/hosts/laptop-phobos/default.nix b/nixos/hosts/laptop-phobos/default.nix index b3e4b12..73a10c3 100644 --- a/nixos/hosts/laptop-phobos/default.nix +++ b/nixos/hosts/laptop-phobos/default.nix @@ -96,8 +96,14 @@ partOf = lib.mkForce [ "xorg-wm-session.target" ]; wantedBy = lib.mkForce [ "xorg-wm-session.target" ]; }; + services = { - logind.lidSwitch = "suspend"; # suspend on lid close + logind.lidSwitch = "suspend"; # suspend on lid close + logind.lidSwitchDocked = "ignore"; # suspend on lid close + # TODO: this is here because when the laptop is docked, and Wayland/X session + # ends, it is for a brief moment not in docked state, which suspends it. + # Since it is also on external power, this effectively means it will be ignored + logind.lidSwitchExternalPower = "ignore"; # suspend on lid close libinput = { enable = true; touchpad = { -- 2.48.1