summaryrefslogtreecommitdiffstats
path: root/.bin/ag-lock
blob: e3402455d37fcae6f834ffe5e24820e6ea865003 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

set -xe

if pgrep xidle >/dev/null; then
	pkill -USR1 xidle &
elif command -v xsecurelock >/dev/null; then
	xsecurelock &
fi

if [ ! "${1}" = "-s" ]; then
	exit 0
fi

sleep 1

if command -v systemctl; then
	systemctl suspend
elif command -v zzz; then
	! doas -n zzz && zzz
fi
remember that computers suck.