From 9d8a10ea9ef7305fd6b4d9aaf165c6098ebeea6e Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Thu, 24 Sep 2026 11:34:46 +0200 Subject: feat(sway): suspend and lock when closing laptop lid --- nixos/profiles/workstation/graphical.nix | 1 + user/sway/config | 3 +++ 2 files changed, 4 insertions(+) diff --git a/nixos/profiles/workstation/graphical.nix b/nixos/profiles/workstation/graphical.nix index f356cda..707df27 100644 --- a/nixos/profiles/workstation/graphical.nix +++ b/nixos/profiles/workstation/graphical.nix @@ -57,6 +57,7 @@ environment.systemPackages = with pkgs; [ wmenu + swayidle swaylock # CLI tools diff --git a/user/sway/config b/user/sway/config index dfb70eb..c0a715c 100644 --- a/user/sway/config +++ b/user/sway/config @@ -40,6 +40,9 @@ set $menu wmenu-run # your displays after another 300 seconds, and turn your screens back on when # resumed. It will also lock your screen before your computer goes to sleep. +exec swayidle -w \ + before-sleep 'swaylock -f' + ### Input configuration # # Example configuration: -- cgit v1.3.1