Skip to content

Instantly share code, notes, and snippets.

Created May 10, 2013 22:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/5557896 to your computer and use it in GitHub Desktop.
Save anonymous/5557896 to your computer and use it in GitHub Desktop.
#!/bin/sh
REMOTE_DISPLAY=$(ssh $1 -T 'cat .display-$(cat /etc/hostname)')
if [ "$REMOTE_DISPLAY" = "" ]; then
echo "Could not find remote display on $1." >> /dev/stderr
exit 1
fi
ATTACH_TO=ssh:$1$REMOTE_DISPLAY
echo "Attaching to $ATTACH_TO..." >> /dev/stderr
xpra attach ssh:$1$REMOTE_DISPLAY --socket-dir=/tmp/xpra-$USER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment