Date: Fri, 1 Jun 2001 21:03:48 -0400 (EDT) From: "Christopher W. Aiken" <cwaiken@icubed.com> To: Ryan Thompson <ryan@sasknow.com> Cc: FreeBSD-QUESTIONS <freebsd-questions@FreeBSD.ORG>, "Christopher W . Aiken" <cwaiken@icubed.com> Subject: Re: Script Question Message-ID: <20010601205542.P780-100000@bigdaddy.localdomain> In-Reply-To: <Pine.BSF.4.21.0106011805100.78185-100000@ren.sasknow.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 1 Jun 2001, Ryan Thompson wrote: :)John Merryweather Cooper wrote to Christopher W . Aiken: :) :)> On 2001.06.01 15:00 Christopher W. Aiken wrote: :)> > :)> > What can I check in a tcsh script to see if X is running? :)> > :)> > :)> > -=[cwa]=- :)> > FreeBSD 4.2 :)> > :)> The DISPLAY environment variable (usually only set when X is running) :)> would be a good choice. Checking the TERM variable for an xterm :)> variant might also work (sometimes). :) :)Yes, but perhaps it pays to ask the poster for more information, here. :) :)Chris, do you need this script to check THE CURRENT SHELL to see if the :)shell itself is running under X, or do you need to be able to detect from :)anywhere, any user, whether X is running? (eg, at the console) :) :)If it is the latter, there may be some hooks that I'm not familiar with, :)but something as crude as the following (off the top of my head)... :) :)if [ ps -ax | grep /usr/X11R6/bin/X | grep -v grep ]; then :) ... :)fi :) :)...might work for you. :) Sorry for the lack of information. The problem is with the "TERM" environment variable. When I login (non GUI) the TERM variable is set to "cons25". When I issue a "startx" TERM is still "cons25". If I ssh into my office w/o first setting TERM to "xterm" my office session is all screwed up. If I set TERM to xterm in my console windows, then my local session is all screwed up. What I'm looking for is a way to auto set TERM to xterm when I startx. I thought someting in my .tcshrc file might be able to do that. Any ideas? -=[cwa]=- FreeBSD 4.2 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010601205542.P780-100000>