Files
dotfiles/homedir/.config/watchman/init.d/lockd
T

31 lines
484 B
Bash
Raw Normal View History

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