#!/bin/bash # This script was written by Daniele Favara # Stripped for keytouch by Rodrigo Gallardo set -e while [ ! -z "$1" ];do case "$1" in --help|-h) echo "Usage: keytouchd-launch [command]" echo "Launch the keytouch daemons in background, before running COMMAND." echo "Please see 'man keytouchd-launch' for details." exit ;; *) SESSION=$@ ; shift $# ;; esac done if [ "x$SESSION" = "x" ]; then # No session? We die echo "You must provide a command to run." exit 1 else keytouchd & # Run the session, kill the daemons afterwards $SESSION killall keytouchd-launch exit $? fi