PDA

View Full Version : More on X11.app


ericw13
01-09-2003, 04:08 PM
Having some strange issues... looking for comments/advice.

I previously installed XFree86 manually, not with fink. I also had XDarwin (as I assume most of us did). X11.app installed with no problems. Running it has been another story.

First, here is ~/.xinitrc

/usr/X11R6/bin/quartz-wm
. $HOME/.profile
xterm -geometry 80x24+0+20 -fg white -bg black -sb -rightbar


First problem is the xterm is not being created with X11 starts up. I added it to the Applications window, where it will happily create a new xterm.

The next problem is the xterm itself. The top bar of the window has nice Aqua-fied widgets, but the scrollbar is the nasty old speckled gray, only works with middle/right click, ugly one we loved to hate back in the day.

Finally, terminal.app windows (running bash as the shell) happily executed my .profile when they started. xterm windows in X11.app are picky... I created a .bashrc with . .profile to make that part work (setting path, exporting other variables, etc.)

Anyone know how to get the xterm to start when X11.app is started? Anyone know how to get an Aqua-fied scrollbar instead of the ugly one? In essence, I want it to look like Terminal.app windows minus the transparency.

Eric

Dr.Evil
01-09-2003, 05:19 PM
Originally posted by ericw13
First, here is ~/.xinitrc

/usr/X11R6/bin/quartz-wm
. $HOME/.profile
xterm -geometry 80x24+0+20 -fg white -bg black -sb -rightbar


First problem is the xterm is not being created with X11 starts up.

cut

Anyone know how to get the xterm to start when X11.app is started?

Try this for your .xinitrc instead:

. $HOME/.profile
exec xterm -geometry 80x24+0+20 -fg white -bg black -sb -rightbar
quartz-wm


The 'exec' command causes the xterm to detach into a separate process. When .xinitrc runs a command without the 'exec' prefix, it waits for it to return before continuing. When quartz-wm runs, since it is a window manager, it doesn't return until X is quitting, and thus blocks you from starting any other processes. So you want to make sure that the only command run without 'exec' is the last one in .xinitrc.

On your other questions, I'm afraid I can't be of much help.

ericw13
01-09-2003, 05:42 PM
Dr. Evil,
The problem with that approach is that you are starting the xterm before the window manager. This produces a black rectangle of appropriate geometry, but it's not in a proper window.

This was my starting point before, then my .xinitrc degenerated to what you saw in my prior post...

Eric

Dr.Evil
01-09-2003, 06:09 PM
I had a couple details wrong. Here's the fix:

#!/bin/bash
. $HOME/.profile
exec xterm -geometry 80x24+0+20 -fg white -bg black -sb -rightbar &
quartz-wm

You have to specify a '&' at the end of your other invocations, indicating that they should run in the background. Otherwise, X11 just starts an xterm and waits for it to complete, even with the 'exec' keyword. The 'exec' keyword, or rather the lack thereof, tells X11 that when the non'exec'-ed process exits, it should quit. X11.app overrides this behavior, apparently, but the syntax is still necessary in .xinitrc.

Starting the quartz-wm second doesn't hurt anything. When it starts, it assumes parental control over all X11 windows, adding the titlebar and control widgets. The only problem was, the previous version of my script wasn't getting to it.

ericw13
01-09-2003, 06:47 PM
D'oh! Shoulda never missed the & on the xterm command. I'm not really that stupid. I didn't know about the wm taking over if it's started after an application.

When I used XDarwin and BlackBox WM, I got it all working with the wm first, then the xterm.

Thanks for the help!
Eric