dotfiles/.config/sway/clam.sh

15 lines
288 B
Bash
Executable file

#!/bin/sh
LAPTOP_OUTPUT="eDP-1"
LID_STATE_FILE="/proc/acpi/button/lid/LID/state"
read -r LS <"$LID_STATE_FILE"
case "$LS" in
*open) swaymsg output "$LAPTOP_OUTPUT" enable ;;
*closed) swaymsg output "$LAPTOP_OUTPUT" disable ;;
*)
echo "Could not get lid state" >&2
exit 1
;;
esac