From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103734,674f735b36ac5ffe X-Google-Attributes: gid103734,public X-Google-Thread: fee84,674f735b36ac5ffe X-Google-Attributes: gidfee84,public X-Google-Thread: 1070f0,674f735b36ac5ffe X-Google-Attributes: gid1070f0,public X-Google-ArrivalTime: 1994-10-08 01:36:50 PST Path: bga.com!news.sprintlink.net!howland.reston.ans.net!math.ohio-state.edu!jussieu.fr!univ-lyon1.fr!ws41.cnusc.fr!ciril.fr!univ-lille1.fr!omega!dubus From: dubus@omega.univ-lille1.fr (Georges Dubus) Newsgroups: comp.windows.x,comp.sys.sun.admin,comp.unix.osf.osf1 Subject: Re: Any script for setting the DISPLAY variable? Followup-To: comp.windows.x,comp.sys.sun.admin,comp.unix.osf.osf1 Date: 7 Oct 1994 15:50:05 GMT Organization: Universite des Sciences et Technologie de LILLE, France Distribution: usa Message-ID: <373qnd$id@netserver.univ-lille1.fr> References: <35s3f6$4es@bigdog.fred.net> <36uhtn$5du@mrnews.mro.dec.com> NNTP-Posting-Host: omega.univ-lille1.fr X-Newsreader: TIN [version 1.2 PL2] Xref: bga.com comp.windows.x:12352 comp.sys.sun.admin:17095 comp.unix.osf.osf1:3940 Sean J. Anaya (sanaya@vrl.nmsu.edu) wrote: : This should work: : #Set the default X server. : #if ($?DISPLAY == 0) then : # if ($?REMOTEHOST) then : # setenv DISPLAY ${REMOTEHOST}:0.0 : # else : # setenv DISPLAY :0.0 : # endif : #endif : -- : ***************************************************************************** : Sean J. Anaya PO Box 30001-0001, DEPT 3ARP : System Administrator Las Cruces, NM 88003-0001 : Visioneering Research Laboratory Tel: (505) 646-8067 : E-Mail: sanaya@vrl.nmsu.edu Fax: (505) 646-8071 : WWW http://vitoria.nmsu.edu/ : "Hope is the thing with feathers : That perches in the soul : And sings the tune--without the words : And never stops at all...." : --Emily Dickinson -- On most of Unix systems the command (shell script) named "xon" can be used for this purpose: This command is provided with X11 distrib on DEC OSF/1 --> /usr/bin/X11/xon #!/bin/sh # # ***************************************************************** # * * # * Copyright (c) Digital Equipment Corporation, 1991, 1994 * # * * # * All Rights Reserved. Unpublished rights reserved under * # * the copyright laws of the United States. * # * * # * The software contained on this media is proprietary to * # * and embodies the confidential technology of Digital * # * Equipment Corporation. Possession, use, duplication or * # * dissemination of the software and media is authorized only * # * pursuant to a valid written license from Digital Equipment * # * Corporation. * # * * # * RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure * # * by the U.S. Government is subject to restrictions as set * # * forth in Subparagraph (c)(1)(ii) of DFARS 252.227-7013, * # * or in FAR 52.227-19, as applicable. * # * * # ***************************************************************** # # HISTORY # # start up xterm (or any other X command) on the specified host # Usage: xon host [arguments] [command] case $# in 0) echo "Usage: $0 [-user user] [-name window-name] [-debug]" echo "[-screen screen-number] [command ...]" exit 1 ;; esac target=$1 shift label=$target resource=xterm-$label rcmd="rsh $target" case $DISPLAY in unix:*) DISPLAY=`echo $DISPLAY | sed 's/unix//'` ;; local:*) DISPLAY=`echo $DISPLAY | sed 's/local//'` ;; esac case $DISPLAY in :*) fullname=`hostname` hostname=`echo $fullname | sed 's/\..*$//'` if [ $hostname = $target -o $fullname = $target ]; then DISPLAY=$DISPLAY rcmd="sh -c" else DISPLAY=$fullname$DISPLAY fi ;; esac username= xauth= case x$XUSERFILESEARCHPATH in x) xpath='HOME=${HOME-`pwd`} ' ;; *) xpath='HOME=${HOME-`pwd`} XUSERFILESEARCHPATH=${XUSERFILESEARCHPATH-"'"$XUSERFILESEARCHPATH"'"} ' ;; esac redirect=" < /dev/null > /dev/null 2>&1 &" command= ls=-ls continue=: while $continue; do case $1 in -user) shift username="-l $1" label="$target $1" rcmd="rsh $target $username" shift case x$XAUTHORITY in x) XAUTHORITY="$HOME/.Xauthority" ;; esac case x$XUSERFILESEARCHPATH in x) ;; *) xpath="XUSERFILESEARCHPATH=$XUSERFILESEARCHPATH " ;; esac ;; -access) shift xhost +$target ;; -name) shift label="$1" resource="$1" shift ;; -nols) shift ls= ;; -debug) shift redirect= ;; -screen) shift DISPLAY=`echo $DISPLAY | sed 's/:\\([0-9][0-9]*\\)\\.[0-9]/:\1/'`.$1 shift ;; *) continue=false ;; esac done case x$XAUTHORITY in x) ;; x*) xauth="XAUTHORITY=$XAUTHORITY " ;; esac vars="$xpath$xauth"DISPLAY="$DISPLAY" case $# in 0) $rcmd 'sh -c '"'$vars"' xterm '$ls' -name "'"$resource"'" -T "'"$label"'" -n "'"$label"'" '"$redirect'" ;; *) $rcmd 'sh -c '"'$vars"' '"$*$redirect'" ;; esac Hope this help you ------------------------------------------------------------------------------ Georges DUBUS Centre Interuniversitaire de Traitement de l'Information Universite des Sciences et Technologies de LILLE Domaine Universitaire Scientifique Batiment M4 59655 Villeneuve d'Ascq cedex Tel: ++33 20 43 45 55 Fax: ++33 20 43 66 25 Email: Georges.Dubus@univ-lille1.fr -------------------------------------------------------------------------------