25 lines
515 B
Bash
Executable File
25 lines
515 B
Bash
Executable File
#!/usr/bin/env ssm
|
|
# vim: ft=sh
|
|
|
|
service_respawn = always
|
|
service_command = "$HOME/bin/lockd" i3lock-extra -s -o ~/pics/lock.png -p -g -- -e -f
|
|
|
|
function pre_start {
|
|
notify-send 'ssm' "Starting $service_name; press again to lock."
|
|
}
|
|
|
|
function start_or_lock {
|
|
if ! status; then
|
|
"$0" "$service_name" start
|
|
else
|
|
"$0" "$service_name" lock
|
|
fi
|
|
}
|
|
|
|
function pre_lock { notify-send 'ssm' "Locking..."; }
|
|
function lock { kill -USR1 "$service_pid"; }
|
|
|
|
function pre_stop {
|
|
notify-send 'ssm' "Stopping $service_name"
|
|
}
|