Usenet comp.unix.osf.misc (1992-2004)
 help / color / mirror / Atom feed
From: "Alan J. Wylie" <alanw@cyrano.com>
To: john.s.haro@boeing.com
Subject: Re: [Q] X remote display detection on login
Date: 1998/10/21	[thread overview]
Message-ID: <362D9D8B.A2696134@cyrano.com> (raw)
In-Reply-To: 362D0E43.7D5D@boeing.com

John Stephen Haro wrote:
> 
> Anyone have a chuck of a .login script for DUX4.0D they can zing me that
> will set the DISPLAY variable automatically on remote login?
> 

The following (korn/bash) script works for me,
across all the common platforms.

Are you really still using csh? - Translation
left as an exercise for the reader.

The who in /usr/local/bin would be the gnu one.
As it is one of those code fragments that, like topsy, just grow,
It could probably be greatly improved.

Hope this helps

---------<cut here>---------------------
if [ -z "$DISPLAY" ]
then
    if [ `which who` = "/usr/local/bin/who" ]
    then
            DISPLAY=`who am i`
    else
        case `uname` in
        HP-UX)
            DISPLAY=`who -R am i`
            ;;
        OSF1)
            DISPLAY=`who -M am i`
            ;;
        *)
            DISPLAY=`who am i`
        esac
    fi

    DISPLAY=`IFS="()" ; set $DISPLAY; echo $2`

    case `uname` in
    AIX|Linux)
        # truncated to 16 chars, so strip off domain
        DISPLAY=`echo $DISPLAY | sed 's/\..*//'`
        ;;
    esac

    DISPLAY=$DISPLAY:0.0
    export DISPLAY

    echo "export DISPLAY=$DISPLAY"
fi
---------<cut here>---------------------

-- 
Alan J. Wylie (Cyrano UK Ltd.) | mailto:awylie@cyrano.com
http://www.cyrano.com          | http://www.zen.co.uk/home/page/alan.wylie
It's much easier to design in reliability, then add in ease of use,
than the other way round.



  reply	other threads:[~1998-10-21  4:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-10-20  4:00 [Q] X remote display detection on login John Stephen Haro
1998-10-21  4:00 ` Alan J. Wylie [this message]
1998-10-21  4:00 ` David Stanaway
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox