Wes Miller
Wes Miller

Reputation: 2241

Linux - Make Application started in a terminal launch on a different display

I have inherited an application that is launched at login time from my server's .bashrc. The application starts two gnome-terminals. If I am logged in with a gnome desktop, it works great. Two terminals open on the desktop.

Sometimes I kill the application and must restart it. Works great if I launch it by hand from a terminal on the desktop (causing me to have 3 terminals open).

However, if I telnet into the machine where the application is installed, as .bashrc executes I get all sorts of "cannot open display" errors.

Well, of course I can't, I'm not logged in from a gui interface, But a desktop IS running on my server and is logged in using the same ID! Why not put the terminals there?

So how do I say, in bash, "start this application and send its output to 1) the display where you are now, or, 2) the one currently up on the server?" (I assume that found by looking at the env var display?)

Ubuntu 10.04 64 bits. I telnet to the server to start the vncserver so I can access the aforementioned desktop.

Thanks,

Upvotes: 2

Views: 5432

Answers (1)

pgl
pgl

Reputation: 8031

It depends on the application exactly, but generally you simply export the DISPLAY environment variable and the application should start on the specified display.

eg:

export DISPLAY=localhost:0.1
xterm &

Some applications would also (or alternatively) take a --display command line argument - check into the specific options available for the applications you're using.

Upvotes: 3

Related Questions