dotfiles/homedir/.config/ssm/services/lockd
fbt 1b70d70942 changes
Signed-off-by: fbt <fbt@fleshless.org>
2023-03-07 13:45:07 +00:00

25 lines
512 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 -- -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"
}