I wrote this code:
void main() { execl("/usr/X11R6/bin/xclock","-display :0",NULL); sleep(10); }
Now I 'xhost +' ! (To disable the access control) Now compile it and then run it! If you run it from a xterm window... The clock runs ... But if I run it from a tty.. ie the text terminal... it says "Error: Can't open Display" What is the problem ??? I want a simple program .. which must be able to exec a xclock on desktop ':0' ... when I run the program from text terminal (tty) logged in as root ! Thanks in advance !!!!
On Thu, 28 Nov 2002, Akhilesh S Shirbhate wrote:
Now I 'xhost +' ! (To disable the access control) Now compile it and then run it! If you run it from a xterm window... The clock runs ... But if I run it from a tty.. ie the text terminal... it says "Error: Can't open Display"
try giving the IP address also: -display ip_address:0
Philip
I wrote this now :
void main() { extern char ** environ; execl("/home/akhilesh/TRIALS_PROJECT/DEAMONS/Button","-display 10.129.32.27:0",NULL); }
The error shown was :
-display 10.129.32.27:0: cannot connect to X server
Now what to do :(( ... I got stuck !!!
try giving the IP address also: -display ip_address:0
Philip
U just got to change the DISPLAY variable .
Use this command 'export $DISPLAY=:0.0' at the tty ( or u can make appropriate changes in the program ).
This should help
Regards Tapesh
--- Akhilesh S Shirbhate akhilesh@it.iitb.ac.in wrote:
I wrote this now :
void main() { extern char ** environ;
execl("/home/akhilesh/TRIALS_PROJECT/DEAMONS/Button","-display
10.129.32.27:0",NULL);
}
The error shown was :
-display 10.129.32.27:0: cannot connect to X server
Now what to do :(( ... I got stuck !!!
try giving the IP address also: -display
ip_address:0
Philip
--
**********************************************************
Never say die unless you are dead !
- .oooO
- ( ) Oooo. Only those who will risk going too
far *
- \ ( ( ) Can possibly find out how far one
can go!*
- _) ) /
(_/ http://www.it.iitb.ac.in/~akhilesh/
**********************************************************
__________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
On Thursday 28 November 2002 11:28 am, Akhilesh S Shirbhate wrote:
"Error: Can't open Display" What is the problem ??? I want a simple program .. which must be able to exec a xclock on desktop ':0' ... when I run the program from text terminal (tty) logged in as root ! Thanks in advance !!!!
Set environment variable DISPLAY to a proper value in your text terminal. This will solve your problem. The command will be as follows, export DISPLAY=host_ip_where_display_is_needed:0.0
you can use setenv() function to set this value from your c code.
Regards aseem
Aseem Rane wrote:
On Thursday 28 November 2002 11:28 am, Akhilesh S Shirbhate wrote:
"Error: Can't open Display" What is the problem ??? I want a simple program .. which must be able to exec a xclock on desktop ':0' ... when I run the program from text terminal (tty) logged in as root ! Thanks in advance !!!!
Set environment variable DISPLAY to a proper value in your text terminal. This will solve your problem. The command will be as follows, export DISPLAY=host_ip_where_display_is_needed:0.0
you can use setenv() function to set this value from your c code.
Thanx boss... it worked !!!!! You solved a big problem... I got stuck on it since last three huors !!!! Thanx again !!!!
On Thursday 28 November 2002 11:28 am, Akhilesh S Shirbhate wrote:
Now I 'xhost +' ! (To disable the access control)
It is a bad thing to do just 'xhost +' without specifying the host for which you want to disable access control. Its a security risk. Anybody can then connect to your X server and grab all you keyboard events (including all the passwords you type along with the usernames) etc.
Regards aseem