diff --git a/bin/sway-lid-watcher.sh b/bin/sway-lid-watcher.sh new file mode 100755 index 0000000..6b2e7bf --- /dev/null +++ b/bin/sway-lid-watcher.sh @@ -0,0 +1,9 @@ +#! /bin/bash + +output="eDP-1" + +if grep -q open /proc/acpi/button/lid/LID/state; then + swaymsg output $output enable +else + swaymsg output $output disable +fi diff --git a/config/.config/sway/config b/config/.config/sway/config index 3c76780..7299c00 100644 --- a/config/.config/sway/config +++ b/config/.config/sway/config @@ -89,8 +89,8 @@ output $mainMonitor { mode 1920x1080@144Hz } -bindswitch --reload lid:on exec "$HOME/dotfiles/bin/lock.sh" -bindswitch --reload lid:off exec 'swaymsg "output eDP-1 enable"' +bindswitch --reload --locked lid:on exec "$HOME/dotfiles/bin/lock.sh" +bindswitch --reload --locked lid:off exec 'swaymsg "output eDP-1 enable"' @@ -142,6 +142,7 @@ exec_always --no-startup-id $HOME/go/bin/walle --restore exec_always --no-startup-id $HOME/dotfiles/bin/swayidle.sh exec_always --no-startup-id libinput-gestures-setup restart exec_always --no-startup-id $HOME/dotfiles/bin/initial-mic-state.sh +exec_always --no-startup-id $HOME/dotfiles/bin/sway-lid-watcher.sh