Go Back   The macosxhints Forums > OS X Help Requests > UNIX - X11



Reply
 
Thread Tools Rate Thread Display Modes
Old 03-26-2003, 08:22 PM   #1
UltraNurd
Major Leaguer
 
Join Date: Sep 2002
Location: Cambridge, MA
Posts: 367
Unexpected automatic opening of X11

I have X11 set up to open automatically in my .tcshrc file with:
Code:
open /Applications/X11.app
.

There are three cases where this simple method causes X11 to open or be brought to the foreground when I don't want it to, so I would like some suggestions on making this more robust.

1) If I open a new Terminal window while X11 is already open, X11 is brought to the front.

2) If I log back into my machine from a remote machine (for example, using scp), X11 is opened or brought to the front.

3) If I run a compiler in Emacs or Project Builder, X11 is opened or brought to the front.

Basically, I want to know how to check if (a) X11 is already open, in which case, don't try to re-open it, and (b) actually opening a Terminal window is what ran my .tcshrc, in which case, open X11 for the first time.
UltraNurd is offline   Reply With Quote
Old 03-26-2003, 09:14 PM   #2
mervTormel
League Commissioner
 
Join Date: Jan 2002
Posts: 5,536
.tcshrc should run silent. don't put interactive things in your .tcshrc

put interactive commands in your .login

and you can test if X11 is running:

Code:
[ ! `ps wwaxl | grep '[X]11'` ] && open ...
so that only the first terminal window, or subsequent windows, if you quit X11, will open the app
__________________
On a clear disk, you can seek forever.
mervTormel is offline   Reply With Quote
Old 04-01-2003, 01:09 AM   #3
wgscott
Major Leaguer
 
Join Date: Sep 2002
Posts: 350
Why don't you instead put it in system preferences login items. That way it will start when you log it and will always be there. In addition, I used an application called Dockless to remove the X icon from the dock and menu bar, and I just launch xwindows applications from the terminal command line. Then it never pops in front.
wgscott is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 05:25 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.