home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.sun.apps
- Path: sparky!uunet!mcsun!sunic!ericom!eos.ericsson.se!etxmesa
- From: etxmesa@eos.ericsson.se (Michael Salmon)
- Subject: Re: openwin and DISPLAY
- Message-ID: <1992Sep10.130217.8665@ericsson.se>
- Sender: news@ericsson.se
- Nntp-Posting-Host: eos6c02.ericsson.se
- Reply-To: etxmesa@eos.ericsson.se (Michael Salmon)
- Organization: Ericsson Telecom AB
- References: <1992Sep6.123129.5343@ukw.uucp> <1992Sep10.120547.26796@cbnewsh.cb.att.com>
- Date: Thu, 10 Sep 1992 13:02:17 GMT
- Lines: 95
-
- In article <1992Sep10.120547.26796@cbnewsh.cb.att.com>,
- wolf@mt.att.com (Thomas Wolf) writes:
- |> In article 5343@ukw.uucp, lupe@ukw.uucp (Lupe Christoph) writes:
- |> "> "wolf@mt.att.com (Thomas Wolf) writes:
- |> "> "
- |> "> ">This is probably a FAQ: Why does the openwin script overwrite the DISPLAY
- |> "> ">variable with its own ":0"? An application I'm running under OW3.0 needs
- |> "> ">to have at least "unix" or a hostname in that variable. What's the simplest
- |> "> ">solution to retaining the variable?
- |> "> "
- |> "> "From "man openwin":
- |> "> "
- |> "> " DISPLAY
- |> "> " By default this is ":0" meaning this xnews server is
- |> "> " the first (zero based) one running on this machine. If
- |> "> " you need to run more than one server on a given
- |> "> " machine, use the "-display" option.
- |> "> "
- |> "> "The man pages are a bit fuzzy on this. But you *can* use the -display
- |> "> "option with openwin just like that used by the clients.
- |>
- |> That's not quite true. When I try "openwin -display unix:0.0" (which is quite
- |> legal with most/some/whatever x-clients) the server complains about invalid
- |> command-line arguments. I think the above just gives you the option of specifying
- |> a different display number - e.g. "openwin -display :1".
- |>
- |> I originally asked the question because I had an "ill-behaving" application (ie.
- |> my application :-) that required the DISPLAY variable to have _something_ before
- |> the colon. I didn't realize know, at the time, that wasn't necessarily the case.
- |> However, the question itself is still valid. I don't think the "openwin" script
- |> should decide for the user what to set DISPLAY to -- iff the user already has an
- |> environment variable of that name set.
-
- The problem here seems to be xnews, from its man page:
-
- xnews [ :display ] ...
-
- I your application needs DISPLAY set as you could just grab the openwin
- script, change:
-
- # default DISPLAY is :0
- DISPLAY=":0"
-
- to:
-
- # default DISPLAY is :0
- DISPLAY="${DISPLAY-:0}"
-
- and:
-
- # start up xinit and thus the server.
- $OPENWINHOME/bin/xinit -- ${SERVER-$OPENWINHOME/bin/xnews} \
- $DISPLAY $PASSTHRU $AUTH
-
- to:
-
- # start up xinit and thus the server.
- $OPENWINHOME/bin/xinit -- ${SERVER-$OPENWINHOME/bin/xnews} \
- `echo $DISPLAY|sed -e 's/^.*:/:/' $PASSTHRU $AUTH
-
- and get rid of the error display by changing:
-
- # complain if $DISPLAY doesn't begin with a colon.
- case "$DISPLAY" in
- :*)
- ;;
- *)
- err "\"$DISPLAY\" is an illegal value for \$DISPLAY"
- ;;
- esac
-
- to:
-
- # complain if $DISPLAY doesn't have a colon.
- case "$DISPLAY" in
- *:*)
- ;;
- *)
- err "\"$DISPLAY\" is an illegal value for \$DISPLAY"
- ;;
- esac
-
-
- Untested I'm afraid, but not much can go wrong.
-
- --
-
- Michael Salmon
-
- #include <standard.disclaimer>
- #include <witty.saying>
- #include <fancy.pseudo.graphics>
-
- Ericsson Telecom AB
- Stockholm
-