LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   root cant use display???? (https://www.linuxquestions.org/questions/linux-newbie-8/root-cant-use-display-337608/)

haora 06-27-2005 08:29 AM

root cant use display????
 
Hi!, I'm trying to run a python application (which uses Tkinter), and even when it has no problem running with my user, when I run it as root, it says something like:

_tkinter.TclError: no display name and no $DISPLAY environment variable


And if I do:

export DISPLAY=:0.0

it says:
_tkinter.TclError: this isn't a Tk applicationcouldn't connect to display ":0.0"


Any idea what could be the problem???

Thanks in advance!!!

Haora

reddazz 06-27-2005 08:32 AM

Try doing "xhost +" as a normal user, then run your app as root.

haora 06-27-2005 08:36 AM

It works!!!

Great!, now, how do I make that change permanent???

haora 07-05-2005 07:45 AM

I added this line to the .bashrc file of my root user:

export DISPLAY=:0.0

And now every time I log in as root, I can use my graphic programs, but (there's allways a but....), the cron jobs still don't work...
I have some jobs that require graphic programs (made in python with Tkinter) to be loaded, but every time cron tryes to run those programs the same thing happens:

_tkinter.TclError: no display name and no $DISPLAY environment variable

Any idea as to what else can I do???

Thanks!


All times are GMT -5. The time now is 03:20 PM.