#!/bin/sh kill `/sbin/pidof x2x` > /dev/null 2>&1 # The host to which your preferred input devices are attached. HOST_FROM=foo # The remote host where you want to use your devices HOST_TO=bar # The location of your x2x installation X2X_LOCATION=/usr/bin/x2x SSH_TO_OPTS="-n -q -F $HOME/.ssh/x2xconfig -x $HOST_TO" SSH_FROM_OPTS="-n -q -F $HOME/.ssh/x2xconfig -X $HOST_FROM" X2X_CMD="$X2X_LOCATION -from $HOST_FROM\:0.0 -to \\\$DISPLAY -west -buttonblock" ssh $SSH_TO_OPTS "env DISPLAY=:0.0 ssh $SSH_FROM_OPTS $X2X_CMD"