Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: 2.1.1 and xterm
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 2.1.1 and xterm



Here is a very simple example:

#! /bin/sh

# *** get POSIX path ***
   thepath=`/usr/bin/osascript /Users/john/sw/src/Xterm/getPath.app 2>/dev/null | sed 's|[^/]*$||'`
   #cd "$thepath"; /opt/local/bin/rxvt -tcw -display :0 &
   cd "$thepath"; /opt/local/bin/rxvt -tcw &
# *** bring X11 to the front ***
   /usr/bin/osascript -e 'tell application "/Applications/Utilities/X11.app" to activate'

This script opens rxvt in the directory which is currently being examined by the Finder. I bundle it using Platypus and place the bundle's icon in the Finder toolbar.

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.

When I asked if the launcher could be made a bit smarter (or less finicky) is that it would not launch the extra xterm in the situation when the application that triggered it (in this case rxvt -display :0) has display set to the 'local' screen (:0, local :0, my_computer:0). In other words it would work as if the display variable was not set.

-John


>Can you provide an example of a script that you had to change?


On Dec 15, 2007, at 7:40 PM, John Koren wrote:

Hi Bill

On Dec 15, 2007 6:27 PM, William Mortensen <email@hidden> wrote:
On Dec 15, 2007, at 5:59 PM, John Koren wrote:


> Merl
>
> I understand that when DISPLAY is set to /tmp/launch-xxxx/:0 then
> X11 windows are channeled through this socket. But what is the
> benefit of doing it that way? What was wrong with the 'localhost'?
> Why can't launchd set the DISPLAY to ':0'?
>
> As I mentioned earlier going through localhost still seems to work.
> If you go to terminal.app or xterm and set DISPLAY to ':0' or
> 'localhost:0' or 'your_computer_name:0' and try to launch an X
> application it will open correctly on your local screen.

Only if the X server is already running. If you let DISPLAY stay as /
tmp/launch-blah/:0, then that works whether X11 is running or not.

I guess you did not read my next sentence in which I said t hat it appears that the special socket seems to be superfluous. I did not say that the socket does not work. I was just asking what is its purpose. It seems like a quick hack.



What sort of problems does the new scheme cause for you? I am a little
worried by your email from earlier:

> I like to bundle my applications but when I set the display to say :
> 0 (eg. rxvt -display :0) then the launcher does not start X11 or it
> pops up an extra xterm, depending  if it is a script or a bundle. Of
> course I can rewrite all my scripts and bundles so that they do not
> contain display :0 however it would be nice if the launcher was
> smarter about it so I would not have to remember all these special
> Mac-only details.

You shouldn't be setting DISPLAY at all, nor should your scripts/
bundles be explicitly launching X11. So I don't think I see how there
are any "special Mac-only details" to remember.

I had to rewrite my shell scripts and bundles containing DISPLAY settings to accommodate the new system. I work interchangeably on Mac and Solaris systems and it is a big plus if I can use the same shell scripts on both systems. That's what I meant by Mac-only details.

My system is working very well now. So it's all in the past.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list      (email@hidden)

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.