| @@ -1,9 +1,30 @@ | ||||
| #!/usr/bin/env ssm | ||||
| # vim: ft=sh | ||||
|  | ||||
| service_respawn='true' | ||||
| service_command="$HOME/bin/lockd" | ||||
| service_args=( i3lock-extra -s -o ~/pics/lock.png -g -p ) | ||||
|  | ||||
| lock() { | ||||
| function _lock { | ||||
| 	kill -USR1 "$service_pid" | ||||
| } | ||||
|  | ||||
| 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 | ||||
| } | ||||
|   | ||||
| @@ -4,5 +4,10 @@ | ||||
| [[ $PROXY_HOST ]] || PROXY_HOST='malganis.priv' | ||||
|  | ||||
| service_respawn=true | ||||
| service_command='/usr/bin/ssh' | ||||
| service_args=( -i ~/.ssh/proxy/id_ecdsa -ND 8080 "$PROXY_USER@$PROXY_HOST" ) | ||||
| service_command=( /usr/bin/ssh -i ~/.ssh/proxy/id_ecdsa -ND 8080 "$PROXY_USER@$PROXY_HOST" ) | ||||
|  | ||||
| function info { | ||||
| 	printf 'Name: %s\n' "$service_name" | ||||
| 	printf 'Command: %s\n' "${service_command[*]}" | ||||
| 	(( service_respawn )) && printf 'Respawn: yes\n' | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user