From 7c48e1221c5185434e48b709f27155f66e737ca9 Mon Sep 17 00:00:00 2001 From: Morgan McMillian Date: Wed, 7 Apr 2021 15:05:46 -0700 Subject: [PATCH] fix laptop lid events --- .config/sway/laptop | 6 ++++-- bin/laptop-disp.sh | 8 ++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100755 bin/laptop-disp.sh diff --git a/.config/sway/laptop b/.config/sway/laptop index 15be254..3b00998 100644 --- a/.config/sway/laptop +++ b/.config/sway/laptop @@ -1,8 +1,8 @@ ### Output configuration set $laptop LVDS-1 -#bindswitch --reload lid:on output $laptop disable -#bindswitch --reload lid:off output $laptop enable +bindswitch --reload --locked lid:on output $laptop disable +bindswitch --reload --locked lid:off output $laptop enable bindsym --locked $mod+F8 output $laptop enable bindsym --locked $mod+Mod1+F8 output $laptop disable @@ -12,3 +12,5 @@ bindsym --locked $mod+Mod1+F8 output $laptop disable input type:keyboard { xkb_options ctrl:swapcaps } + +exec_always ~/bin/laptop-disp.sh diff --git a/bin/laptop-disp.sh b/bin/laptop-disp.sh new file mode 100755 index 0000000..a9f75e6 --- /dev/null +++ b/bin/laptop-disp.sh @@ -0,0 +1,8 @@ +#!/bin/bash +source $HOME/.config/sway/displays.sh +if grep -q open /proc/acpi/button/lid/LID/state; +then + swaymsg output $LAPTOP enable +else + swaymsg output $LAPTOP disable +fi