#! /bin/bash

set -e

lock() {
	exec systemctl --user start stne-lock.service
}

unlock() {
	exec systemctl --user stop stne-lock.service
}

usage() {
	cat >&2 <<EOF
Screen Locker

Usage:
  stne-lock COMMAND

Help Options:
  -h --help          Show help options

Commands:
  lock               Lock the screen (default)
  unlock             Unlock the screen
EOF
	exit 2
}

case "$1" in
	lock | "")
		lock ;;
	unlock)
		unlock ;;
	*)
		usage ;;
esac
