X-Git-Url: https://git.madduck.net/etc/ssh.git/blobdiff_plain/63c7606706cca46e64faff36167b62efff1f5ae1..2555490d1d9349e3b19f653ac5d6148ac32f98aa:/.ssh/rc?ds=sidebyside diff --git a/.ssh/rc b/.ssh/rc index a70d65c..a755dca 100644 --- a/.ssh/rc +++ b/.ssh/rc @@ -3,3 +3,14 @@ PERSISTENT_AUTH_SOCK=$VARDIR/ssh/persistent-ssh-auth.sock if [ ! -S "$PERSISTENT_AUTH_SOCK" ] && [ -S "$SSH_AUTH_SOCK" ]; then ln -sf "$SSH_AUTH_SOCK" "$PERSISTENT_AUTH_SOCK" fi + +if [ -n "${DISPLAY:-}" ]; then + read proto cookie + if [ "${DISPLAY%%:*}" = localhost ]; then + # X11UseLocalhost=yes + echo add unix:$(echo $DISPLAY | cut -c11-) $proto $cookie + else + # X11UseLocalhost=no + echo add $DISPLAY $proto $cookie + fi | xauth -q - +fi