aboutsummaryrefslogtreecommitdiff
path: root/laptop/lid-button.sh
blob: 71f67c63209c062e987ec6044ab9204aaac403df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

export SWAYSOCK=/run/user/1000/sway-ipc.1000.$(pgrep -x sway).sock

case "$3" in
	close)
        logger "LID close on custom";
        if [ "$(ps cax | grep sway)" ]; then
            su yaroslav -c "swaymsg exec 'swaysession suspend'"
        else
            systemctl suspend
        fi
		;;
	open)
		logger "LID open on custom" ;;
	*)
		logger "LID undefined action $1" ;;
esac