summaryrefslogblamecommitdiffstats
path: root/.bin/ag-lock
blob: e3402455d37fcae6f834ffe5e24820e6ea865003 (plain) (tree)




















                                            
#!/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.