# $Platon: bashrc,v 1.1 2002/07/31 09:57:47 rajo Exp $ # On remote host put these lines to your ~/.bashrc if you # are using bash # Set $DISPLAY enviroment if there is a record in ~/.Xauthority file # and user is logged in via ssh disp() { local DISP export DISPLAY= if [ "$?SSH_CLIENT" ]; then DISP=`xauth list "$SSH_CLIENT":0 | awk '{print $1}'` if [ ! -z "$DISP" ]; then if [ $SHLVL != 1 ]; then echo "Setting DISPLAY $DISP" fi export DISPLAY=$DISP fi fi } # If login shell then set display if [ "$SHLVL" = 1 ]; then disp fi