PDA

View Full Version : Opening Xterm From Unix Shell




ScKaSx
Jun 6, 2006, 08:07 PM
Hi All,

This problem is linked to several problems I've had graphing in unix. I'm not sure what to set my DISPLAY variable to in the Unix 'env' file. Currently I am using, DISPLAY=:0.0. However, this isn't working, seeing as I can't open X11 from the unix shell and I can't plot using gnuplot. Any help with this would be appreciated.

The application I'm using this for is dynamic plotting from my C program. Please help.

Cheers,
ScKaSx



crackpip
Jun 6, 2006, 10:04 PM
Hi All,

This problem is linked to several problems I've had graphing in unix. I'm not sure what to set my DISPLAY variable to in the Unix 'env' file. Currently I am using, DISPLAY=:0.0. However, this isn't working, seeing as I can't open X11 from the unix shell and I can't plot using gnuplot. Any help with this would be appreciated.

The application I'm using this for is dynamic plotting from my C program. Please help.

Cheers,
ScKaSx

You do have X11.app up and running, right? I have my display set at :0.0 and it works fine. You might try a couple of different X11 apps in /usr/X11R6/bin. I have had issues where certain apps would pop-up just fine, while others failed.

crackpip

ScKaSx
Jun 6, 2006, 11:02 PM
Yeah, I can load display graphics fine from X11. Although (and I know this is nit picky) I wanted to load xterm from the terminal window. I also want to plot mulitple graphics windows from the terminal, which it doesn't seem capable to do through gnuplot. Let me know if you have any ideas. Thanks.

Cheers,
ScKaSx

plinden
Jun 6, 2006, 11:13 PM
Typing this in Terminal works for me:
open /Applications/Utilities/X11.app/

This opens an xterm without scroll bars, which I don't like, and I usually do the above followed by:
xterm -sb -sl 1000 &

I'm not sure if this is also a problem with you, but if you're having problems displaying in X11, you could also try typing:
xhost +

AlmostThere
Jun 7, 2006, 04:25 AM
You can avoid X11 altogether if you download and install AquaTerm (http://aquaterm.sourceforge.net/).

In your .gnuplot file add "set term aqua" (assuming gnuplot 4.x)

emotion
Jun 7, 2006, 08:35 AM
Typing this in Terminal works for me:
open /Applications/Utilities/X11.app/

This opens an xterm without scroll bars, which I don't like, and I usually do the above followed by:
xterm -sb -sl 1000 &

I'm not sure if this is also a problem with you, but if you're having problems displaying in X11, you could also try typing:
xhost +

Be very careful with that one (xhost +). It's possible to remotely log your keystrokes when your display is open like that.

GeeYouEye
Jun 13, 2006, 02:51 PM
/bin/bash -c "export DISPLAY=:0.0; /usr/X11R6/bin/xterm -e /path/to/gnuplot"

That should work.

mrichmon
Jun 13, 2006, 03:04 PM
Typing this in Terminal works for me:
open /Applications/Utilities/X11.app/

This opens an xterm without scroll bars, which I don't like, and I usually do the above followed by:
xterm -sb -sl 1000 &


If you don't want X11 to automatically open the default xterm window then you can comment out the xterm command from the X11 startup script. The commands started when you launch X11 are defined in the file /etc/X11/xinit/xinitrc.

If you don't want to start an xterm when X11 starts then you should scroll to the bottom of that file to find the line "xterm &" in the section labeled "start some nice programs" comment out the xterm line using a "#" character at the start of the line to stop xterm from loading when X11 starts.

If you do want xterm to start, but you want it to start with particular command line options then you can add those options to the "xterm" line in the xinitrc file. Make sure that the xterm command ends with a "&" character to run xterm in the background.

Note: xinitrc is read only and owned by root so it needs to be edited by a superuser.

Warning: Be very careful editing xinitrc since a bad command in this file will prevent X11 from starting correctly.