diff --git a/bin/_locker b/bin/_locker new file mode 100755 index 0000000..6459453 --- /dev/null +++ b/bin/_locker @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +set -euo pipefail + +if [ "${1-}" = 'dim' ]; then + chayang +fi + +exec swaylock -f -e -F -k -l -c 000000 --indicator-idle-visible diff --git a/sway/config b/sway/config index cbb82c2..5c65e8b 100644 --- a/sway/config +++ b/sway/config @@ -129,12 +129,14 @@ bar { swaybar_command waybar } -set $locker 'swaylock -f -e -F -k -l -c 000000 --indicator-idle-visible' +set $locker '_locker' +set $dimmer '_locker dim' +set $suspend 'systemctl suspend' bindsym $super+Shift+semicolon exec $locker # Automatically lock after 5 minutes, suspend after 5 more exec swayidle -w \ - timeout 300 $locker \ - timeout 600 'systemctl suspend' \ + timeout 300 $dimmer \ + timeout 600 $suspend \ before-sleep $locker # Only show borders if there's more than one window