runit-user-services/input-leapc/run

15 lines
382 B
Bash
Executable file

#!/bin/zsh
source ${0:a:h:h}/import-env.zsh
import-env awesome || exit 1
export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME/.config}
SERVER_FILE=${XDG_CONFIG_HOME}/InputLeap/server
if [[ ! -e $SERVER_FILE ]] then
<<-ERROR
Service requires configuration!
Create \`${SERVER_FILE}\` containing the target server name
ERROR
exit 1
fi
exec 2>&1
exec input-leapc -f $(<${SERVER_FILE})