aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2026-09-24 11:34:46 +0200
committerMartin Fischer <martin@push-f.com>2026-09-24 11:49:52 +0200
commit9d8a10ea9ef7305fd6b4d9aaf165c6098ebeea6e (patch)
tree8a04fb249271508194926882ba983bc934889dc5
parent75eb6609a4bd448c0a8f6766175aff275997847e (diff)
feat(sway): suspend and lock when closing laptop lid
-rw-r--r--nixos/profiles/workstation/graphical.nix1
-rw-r--r--user/sway/config3
2 files changed, 4 insertions, 0 deletions
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: