2018-08-07 19:31:39 +00:00
|
|
|
#!/usr/bin/env ssm
|
|
|
|
# vim: ft=sh
|
|
|
|
|
2019-10-03 09:03:31 +00:00
|
|
|
service_respawn = always
|
2023-03-07 13:45:07 +00:00
|
|
|
service_command = "$HOME/bin/lockd" i3lock-extra -s -o ~/pics/lock.png -p -- -e -f
|
2018-08-07 19:31:39 +00:00
|
|
|
|
2019-10-03 09:03:31 +00:00
|
|
|
function pre_start {
|
|
|
|
notify-send 'ssm' "Starting $service_name; press again to lock."
|
2018-08-07 19:31:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function start_or_lock {
|
2019-10-03 09:03:31 +00:00
|
|
|
if ! status; then
|
|
|
|
"$0" "$service_name" start
|
2018-08-07 19:31:39 +00:00
|
|
|
else
|
2019-10-03 09:03:31 +00:00
|
|
|
"$0" "$service_name" lock
|
2018-08-07 19:31:39 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2019-10-03 09:03:31 +00:00
|
|
|
function pre_lock { notify-send 'ssm' "Locking..."; }
|
|
|
|
function lock { kill -USR1 "$service_pid"; }
|
|
|
|
|
|
|
|
function pre_stop {
|
|
|
|
notify-send 'ssm' "Stopping $service_name"
|
2018-08-07 19:31:39 +00:00
|
|
|
}
|