I just want to check if X is running - for instance: suppose I create an edit script, to open, say vi, if X is not running, or gvim if it is.
I know I can ps -a | grep; but it doesn't seem like the most efficient way.
Also, checking the DISPLAY variable worked rather well until now.
I could also probe the exit status of many commands.
I am just curious what others do.
Somebody once said:
>I think it may help if you clarify the question a little bit.
>
>You are running a script and it needs to ceck for the presence of a
>running X server?
>
>Or are you trying to run X and unable to get the display using a
>specific driver, and there are trying to troubleshoot via a script?
>
>The methodology shouldn't be any different in actuality, just pipe ps
>ax to match X via egrep.
>
>
>On Thu, 18 Nov 2004 15:02:14 -0700, Jared Anderson
><plug@thegoldenedge.com> wrote:
>> Just curious of the most effective way to determine if X is running in a shell script. I have used a few ugly methods of such, but they are ugly: the most recent is no longer effective while using radeonfb driver and splashutils. Any useful input would be appreciated!!
>>
>> Thanks.
>>
>> -----
>> Computers are like air conditioners. Both stop working, if you open windows.
>> -- Adam Heath
>> ---------------------------------------------------
>> PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
>> To subscribe, unsubscribe, or to change you mail settings:
>> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>>
>---------------------------------------------------
>PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
>To subscribe, unsubscribe, or to change you mail settings:
>http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
--
my$.02
---------------------------------------------------
PLUG-discuss mailing list -
PLUG-discuss@lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss