Re: 2.1.1 and xterm
Re: 2.1.1 and xterm
- Subject: Re: 2.1.1 and xterm
- From: "John Koren" <email@hidden>
- Date: Mon, 17 Dec 2007 02:41:47 -0800
Jeremy
On Dec 16, 2007 9:49 PM, Allen Bennettt <
email@hidden> wrote:
On Dec 16, 2007, at 3:32 PM, Jeremy Huddleston wrote:
> if [ -z $DISPLAY ] ; then
> DISPLAY=:0
> /usr/bin/osascript -e 'tell application "/Applications/Utilities/
> X11.app" to activate'
> fi
> cd `/usr/bin/osascript /Users/john/sw/src/Xterm/getPath.app 2>/dev/
> null | sed 's|[^/]*$||'`
> /opt/local/bin/rxvt -tcw &
Jeremy, the reason I have "/usr/bin/osascript -e 'tell application /Applications/Utilities/X11.app to activate" at the end of the script is to bring
X11.app to the top. Otherwise, when I bundle the script using Platypus, the rxvt window launches under the Finder window which initiated the script.
In Tiger, the call /opt/local/bin/rxvt -tcw & would bring the rxvt to the front, in Leopard this is not the case.
>
> You shouldn't set the display, you should let it inherit $DISPLAY
> from the environment.
This was done because, at least in the past, bundled scrips would not inherit DISPLAY.
>
>> The original script had '-display :0' in the rxvt call. The script
>> works correctly when I leave '-display :0' out. With '-display :0'
>> in it also works well except during the first launch of X11 it
>> pops up two windows, the one that I selected and the xterm from
>> the launchd.
>
> launchd doesn't start an xterm. Launchd just starts the server.
> Starting an X client (like xterm or X11.app) triggers launchd to
> start the server.
>
> You shouldn't be seeing an extra xterm. xterm is not started in
> this case. Do you have xterm starting in your ~/.xinitrc? I don't
> know osascript. What does that 'to activate' command do? Launch
> X11.app if it's not running or bring it to the foreground? If it
> launches it if not running, then it might just be a race where
> X11.app runs (starting xterm) before rxvt runs. Try adding a
> 'sleep 1' after your rxvt &. Also, X11 now starts in the
> foreground as of 2.1.1.
Activate: (unless you call a specific window) will bring the
application to the front, take focus with the window that was
frontmost last time the application had focus or if it hasn't been
launched open the application in its default state and bring it the
front.
Allen, I do not know how to bring an individual X11 application window to the top. Do you know how to do it? As I said above, re-activating X11.app was one way I was able to bring the new rxvt to the front. In Tiger this call was not needed. My not-so-elegant solution actually does what I intended it to do.
-Allen Bennett
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden