From eeeaa82bc515379c37dcf7d95def91d5a54b3592 Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Thu, 24 Mar 2022 08:58:14 -0400 Subject: [PATCH] meta: Add swayidle This lets us automatically start swaylock on lid close, useful when on the go, although not a replacement for turning off a computer fully. --- sway/.config/sway/config | 3 +++ swayidle/.config/swayidle/config | 2 ++ swayidle/README.md | 16 ++++++++++++++++ 3 files changed, 21 insertions(+) create mode 100644 swayidle/.config/swayidle/config create mode 100644 swayidle/README.md diff --git a/sway/.config/sway/config b/sway/.config/sway/config index e96d9be..782fe38 100644 --- a/sway/.config/sway/config +++ b/sway/.config/sway/config @@ -178,4 +178,7 @@ bindsym XF86MonBrightnessUp exec brightnessctl set +5% # bindsym XF86WLAN exec # bindsym XF86Favorites exec +# Lock the screen after a certain amount of time +exec swayidle -w + include /etc/sway/config.d/* diff --git a/swayidle/.config/swayidle/config b/swayidle/.config/swayidle/config new file mode 100644 index 0000000..81eade2 --- /dev/null +++ b/swayidle/.config/swayidle/config @@ -0,0 +1,2 @@ +timeout 300 swaylock +before-sleep swaylock diff --git a/swayidle/README.md b/swayidle/README.md new file mode 100644 index 0000000..9a27047 --- /dev/null +++ b/swayidle/README.md @@ -0,0 +1,16 @@ +# swayidle + +[swayidle][swayidle] is an idle management daemon for Wayland. + +## Use Cases + +swayidle can be used to: + +- Automatically lock the screen after a period of inactivity +- Automatically lock the screen on lid close (e.g. on a laptop) + +You should not use swayidle if: + +- You don't want to automatically lock the screen. + +[swayidle]: https://github.com/swaywm/swayidle