dotfiles/homedir/.config/watchman/init.d/lockd
fbt 22eac4d45f ?
Signed-off-by: fbt <fbt@fleshless.org>
2018-08-07 22:21:49 +03:00

31 lines
484 B
Bash
Executable File

#!/usr/bin/env ssm
# vim: ft=sh
service_respawn='true'
service_command="$HOME/bin/lockd"
service_args=( i3lock-extra -s -o ~/pics/lock.png -g -p )
function _lock {
kill -USR1 "$service_pid"
}
function lock {
status || {
start; sleep 1
"$0" "$service_name" lock
return "$?"
}
_lock
}
function toggle {
if status; then
out=$( "$0" "$service_name" stop 2>&1 )
notify-send "ssm" "$out"
else
out=$( "$0" "$service_name" start 2>&1 )
notify-send "ssm" "$out"
fi
}