2017-05-03 13:13:50 +00:00
|
|
|
#!/usr/bin/env ssm
|
2017-06-13 13:03:45 +00:00
|
|
|
# vim: ft=sh
|
2017-05-03 13:10:13 +00:00
|
|
|
|
|
|
|
service_respawn='true'
|
|
|
|
service_command="$HOME/bin/lockd"
|
2017-05-03 13:13:50 +00:00
|
|
|
service_args=( i3lock-extra -s -o ~/pics/lock.png -g -p )
|
|
|
|
|
2017-06-13 13:03:45 +00:00
|
|
|
function _lock {
|
2017-05-03 13:13:50 +00:00
|
|
|
kill -USR1 "$service_pid"
|
|
|
|
}
|
2017-06-13 13:03:45 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|