LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 10-14-2002, 06:26 PM   #1
mcwasi
LQ Newbie
 
Registered: Oct 2002
Location: Vienna(AT)/Potsdam(DE)
Distribution: Debian/Ubuntu
Posts: 8

Rep: Reputation: 0
"at" command: cannot open display


I would like to use the "at" command for starting a shell script (at a later time) that opens a window or puts graphic to the X root background (like xv -root). Unfortunately, it does not work because it does not have permission to send anything to the display. The message I get is: "Gdk-WARNING **: cannot open display:"

The script is started properly and works fine. Only the part that should put up graphic to the display does not work, i.e. does not get permission to do so.
Of course, X access is allowed (with xhost +).

I have the impression that the "at" command is intended only for line command scripts that do not open windows or such.
Is there any workaround?

btw, I want to use "at" as user, not as root.

I've been looking for manuals, faqs and docs for hours now, without success.
 
Old 10-14-2002, 08:49 PM   #2
Matt00SS
LQ Newbie
 
Registered: Jul 2002
Posts: 10

Rep: Reputation: 0
Try setting the DISPLAY variable in your shell script...

export DISPLAY=:0


Matt
 
Old 10-14-2002, 10:09 PM   #3
mcwasi
LQ Newbie
 
Registered: Oct 2002
Location: Vienna(AT)/Potsdam(DE)
Distribution: Debian/Ubuntu
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks for your answer!! It's working now!

Here's the complete solution (in case someone has the same problem):

"at" forces your shell script to run in /bin/sh, even if you prepend an #!/bin/bash in your script.
and for some reason, in sh the environment variables seem to be reset to its prior values immediately after being set. so you have to do an
env DISPLAY=:0 xterm
in one command.
 
  


Reply



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
"Xlib: extension "XFree86-DRI" missing on display ":0.0"." zaps Linux - Games 9 05-14-2007 03:07 PM
xset: unable to open display "mycomputer.mynetwork:0.0" nicolaeancuta Linux - Networking 2 07-13-2005 01:39 AM
"Can't open display" error when try to use a program remote heande Linux - Newbie 2 03-11-2005 10:13 AM
'at' command "Cannot open display" Gregory Deal Linux - Software 2 09-30-2004 08:06 PM
unable to open display "24.228.61.72:0.0" while installing oracle remotely cheeku Linux - Newbie 3 08-13-2004 04:08 PM

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

All times are GMT -5. The time now is 07:46 AM.

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
Open Source Consulting | Domain Registration