Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jun 6, 2006, 08:07 PM   #1
ScKaSx
macrumors regular
 
Join Date: Feb 2006
Opening Xterm From Unix Shell

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
ScKaSx is offline   0 Reply With Quote
Old Jun 6, 2006, 10:04 PM   #2
crackpip
macrumors regular
 
Join Date: Jul 2002
Quote:
Originally Posted by ScKaSx
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
crackpip is offline   0 Reply With Quote
Old Jun 6, 2006, 11:02 PM   #3
ScKaSx
Thread Starter
macrumors regular
 
Join Date: Feb 2006
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
ScKaSx is offline   0 Reply With Quote
Old Jun 6, 2006, 11:13 PM   #4
plinden
macrumors 68040
 
plinden's Avatar
 
Join Date: Apr 2004
Typing this in Terminal works for me:
Code:
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:
Code:
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:
Code:
xhost +
plinden is offline   0 Reply With Quote
Old Jun 7, 2006, 04:25 AM   #5
AlmostThere
macrumors 6502a
 
Join Date: Feb 2005
Location: The royal throne of kings, the sceptred isle, the other Eden, the fortress built
You can avoid X11 altogether if you download and install AquaTerm.

In your .gnuplot file add "set term aqua" (assuming gnuplot 4.x)
__________________
Join the army of the dead: http://www.urbandead.com
AlmostThere is offline   0 Reply With Quote
Old Jun 7, 2006, 08:35 AM   #6
emotion
macrumors 68040
 
emotion's Avatar
 
Join Date: Mar 2004
Location: Manchester, UK
Quote:
Originally Posted by plinden
Typing this in Terminal works for me:
Code:
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:
Code:
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:
Code:
xhost +
Be very careful with that one (xhost +). It's possible to remotely log your keystrokes when your display is open like that.
emotion is offline   0 Reply With Quote
Old Jun 13, 2006, 02:51 PM   #7
GeeYouEye
macrumors 68000
 
GeeYouEye's Avatar
 
Join Date: Dec 2001
Location: State of Denial
Send a message via AIM to GeeYouEye Send a message via Yahoo to GeeYouEye
/bin/bash -c "export DISPLAY=:0.0; /usr/X11R6/bin/xterm -e /path/to/gnuplot"

That should work.
__________________
I bring order to chaos. You are in chaos Windows, you are the contradiction, a bug wishing to be an OS.
Visit Softyards Software
NEW DEFINITION OF GEEK
Like politics, free speech, computers, entertainment, and more? Join us at Wordforge.net
GeeYouEye is offline   0 Reply With Quote
Old Jun 13, 2006, 03:04 PM   #8
mrichmon
macrumors 6502a
 
Join Date: Jun 2003
Quote:
Originally Posted by plinden
Typing this in Terminal works for me:
Code:
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:
Code:
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.
mrichmon is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
UNIX Shell Programming, Third Edition, Exercises Solution? shipudenPai Mac Programming 11 Jun 18, 2011 07:28 PM
UNIX Shell script... help! Flying Llama Mac Programming 4 Oct 3, 2009 02:41 AM
Mac OSX Opening .app & UNIX EXEC nevafuse Mac Programming 0 May 18, 2009 02:55 PM
Open SSH and Unix Subsystems via Installer 4.0 scott74 Jailbreaks and iOS Hacks 10 Aug 18, 2008 11:46 PM
Size of unix shell ooagentbender General Mac Discussion 8 Jan 20, 2003 03:22 PM


All times are GMT -5. The time now is 11:46 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC