Re: X11 and do shell script
Re: X11 and do shell script
- Subject: Re: X11 and do shell script
- From: John Fieber <email@hidden>
- Date: Sun, 14 Nov 2004 21:17:42 -0800
On Nov 13, 2004, at 6:36 AM, Bernardo Hoehl wrote:
Can't find X11's dictionary.
Is there one?
SimpleQuestion:
What is the equivalent to "do script with command" and "do shell
script" in X11?
Do shell script.
Unix folks have been using shell scripts to run X11 applications since
the dawn of X11.
I try to tell x11 to do the following command, but it won't work,
unless I type it manually on x11's terminal.
do shell script "/Applications/OpenOffice.org1.0.3/program/soffice"
What is missing is a specification of where the X11 display server is.
Assuming it is on the same machine your script is on, you can usually
use ":0.0" to represent the first screen on the first display on the
local machine, as in:
do shell script "/usr/X11R6/bin/xeyes -display :0.0"
You don't normally have to specify -display when tapping away in an
xterm window because your program inherits the DISPLAY environment
variable from the parent process. Either xterm or some parent of it
set the variable for you. Many, but not all, X11 commands/applications
support a -display argument to override the DISPLAY environment
variable, or specify the display if the variable isn't set. For those
silly ones that don't provide the argument, you have to arrange to set
the variable. This can work if "do shell script" reliably invokes a
Bourne shell:
do shell script "DISPLAY=:0.0 /usr/X11R6/bin/xeyes"
Now, I can't really think of much in X11.app that would be useful to
provide an applescript interface for, but one thing that would be
useful is divining an appropriate display specification for a running
server. :0.0 is an assumption that could be wrong in several ways I
can think of without working too hard.
Note that the "do shell script" call will not return until the
application (xeyes in the above examples) exits.
-john
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden