LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-17-2006, 02:04 AM   #1
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Rep: Reputation: 31
Can i run program in Xwindows enviroment frm giving command to tty ?


Can i run program in XSERVER/Xwindows enviroment from any tty ?

Assuming we have Xwindows environment up & running. So is it possible to run any program to run only in XWINDOWS environment instead of running it on that terminal or as a background process ?

Command on tty1 pops up a terminal window in xwindows & run that command or program ?
 
Old 03-17-2006, 03:09 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
You could have a command run as an argument to xterm.

From the manpage:
Quote:
-e program [ arguments ... ]
This option specifies the program (and its command line
arguments) to be run in the xterm window. It also sets the
window title and icon name to be the basename of the pro‐
gram being executed if neither -T nor -n are given on the
command line. This must be the last option on the command
line.

Last edited by jschiwal; 03-17-2006 at 03:11 AM.
 
Old 03-17-2006, 07:04 AM   #3
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Original Poster
Rep: Reputation: 31
That doesnt work.. I m on CLI.. CTRL+ALT+F1 (tty) & want my command "kcalc" should run Kde calculator on my XWINDOWS interface (CTRL+ALT+F7).

Even if i crontab .. suppose i want to open an instance of kcalc every minute.. it doesnt work.. it sends me a message to my mail stating that
"kcalc: cannot connect to X server"
(Its just for an example purpose, i do not really intent to do that)

I hope you would have got my point.

Can anyone of a bit help to me in this ?
Does GUI scheduler like "XJOB" n others are the only utilies i am left with ?

Last edited by amitsharma_26; 03-17-2006 at 07:08 AM.
 
Old 03-17-2006, 08:16 AM   #4
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,544
Blog Entries: 4

Rep: Reputation: 57
Code:
DISPLAY=:0 xterm
Run that from a tty. It'll set the DISPLAY environment variable to the running X server and then execute the app. The app will look for the display to run on, find the value of $DISPLAY and away we go. Happy endings all round
 
Old 03-17-2006, 09:41 AM   #5
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by cs-cam
Code:
DISPLAY=:0 xterm
Run that from a tty. It'll set the DISPLAY environment variable to the running X server and then execute the app. The app will look for the display to run on, find the value of $DISPLAY and away we go. Happy endings all round
Thanks a lot.
Its working nw.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to run Azureus from Command Line (Not Xwindows)? abcampa Linux - Software 7 10-01-2009 01:15 PM
system("top") in a C program giving problems when the C prg is run by cron rags2k Programming 1 09-02-2004 04:25 PM
command to run a program stupidloser Linux - Newbie 1 08-11-2004 03:55 AM
how do I run a command from inside a c++ program? exodist Programming 1 04-06-2004 05:34 PM
Viewing program messages when program isn't run from command line? Locura Linux - Software 1 09-27-2003 09:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration