aboutsummaryrefslogtreecommitdiff
path: root/laptop/lid-button.sh
blob: 601af5ad124d39779c210468daaa10bd8eef12e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh
case "$3" in
	close)
        logger "LID close on custom";
        if [ "$(ps cax | grep i3)" ]; then
            su yaroslav -c "DISPLAY=:0 i3 exec 'i3session suspend'"
        else
            systemctl suspend
        fi
		;;
	open)
		logger "LID open on custom" ;;
	*)
		logger "LID undefined action $1" ;;
esac