fix laptop lid events

This commit is contained in:
Morgan McMillian 2021-04-07 15:05:46 -07:00
parent b3aaf792a5
commit 7c48e1221c
2 changed files with 12 additions and 2 deletions

View file

@ -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

8
bin/laptop-disp.sh Executable file
View file

@ -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