# HG changeset patch # User Pascal Bellard # Date 1312443879 -7200 # Node ID 0a4cc644e63175c190c7fdad5eb323731a2c7b77 # Parent 94fce58dc7785f2d07299244d80c48dede10c4bc dropbear: not only server :0 diff -r 94fce58dc778 -r 0a4cc644e631 dropbear/stuff/sshx --- a/dropbear/stuff/sshx Wed Aug 03 21:46:06 2011 +0200 +++ b/dropbear/stuff/sshx Thu Aug 04 09:44:39 2011 +0200 @@ -3,12 +3,13 @@ xdbclient() { read host type data - n=10; dpy=localhost:$n - dbclient -R $((6000+$n)):localhost:6000 "$@" \ + svr=$(echo $DISPLAY | sed 's/.*:\([0-9]*\).*/\1/') + n=$((10+$svr)); dpy=localhost:$n + dbclient -R $((6000+$n)):localhost:$((6000+$svr)) "$@" \ "xauth add $dpy $type $data; export DISPLAY=$dpy; $TERM" } -case "$TERM" in -xterm*|rxvt*) xauth list :0 | xdbclient "$@" ;; -*) dbclient "$@" ;; +case "$DISPLAY" in +'') dbclient "$@" ;; +*) xauth list $DISPLAY | xdbclient "$@" ;; esac