summaryrefslogtreecommitdiff
path: root/config/xss-lock/tranfer-sleep-lock-slock-dvs.sh
blob: 1cb3fed37fea33c6b86e94cb66a8b71494246324 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env bash

if [[ -e "/dev/fd/${XSS_SLEEP_LOCK_FD:--1}" ]]; then
	pid="$(slock -kfp {XSS_SLEEP_LOCK_FD}<&-)"
	trap "kill ${pid}" TERM INT
	exec {XSS_SLEEP_LOCK_FD}<&-

	waitpid "${pid}" &
	wait
else
	trap 'kill %%' TERM INT
	slock -k &

	wait
fi