SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Since installing 12.2, some things have not been functioning as expected; the warnings/errors that occur seem to indicate that an environment variable "$DISPLAY" needs to be set. For instance:
Code:
root@abitbox:~# xwininfo -id 0:0
xwininfo: unable to open display ''
I have not been able to determine what that env variable should be set to - could someone help?
I am not an X-pert but I know the DISPLAY environment variable should be the identifier of the X server you want to connect to.
Usually this will be ':0', unless you are running multiple X servers. I have some notes on this from running X sessions across a LAN but that machine is not accessible to me at the moment - I'll try to post some later.
[EDIT]
There is a very short explanation of the $DISPLAY var here.
[/EDIT]
Look at the man page for xwininfo. It wants the window ID, not the display ID
Try running xwininfo with no arguments.
Thank you both for the replies;
I already did that, and it is no help here is what it produces:
Code:
root@abitbox:~# xwininfo
xwininfo: unable to open display ''
usage: xwininfo [-options ...]
where options include:
-help print this message
-display host:dpy X server to contact
-root use the root window
-id windowid use the window with the specified id
-name windowname use the window with the specified name
-int print window id in decimal
-children print parent and child identifiers
-tree print children identifiers recursively
-stats print window geometry [DEFAULT]
-bits print window pixel information
-events print events selected for on window
-size print size hints
-wm print window manager hints
-shape print shape extents
-frame don't ignore window manager frames
-english print sizes in english units
-metric print sizes in metric units
-all -tree, -stats, -bits, -events, -wm, -size, -shape
root@abitbox:~#
Where in the slackware 12.2 system do I look to find the information needed?
@Astrogeek: I already saw that; unfortunately, I still do not know where to find the information that the variable needs to be set to.
Are you running X? y/n
If you are not, you need to run X.
If you are, then: Were you logged in as root when you stated X (from the prompt) or did you su to root?
If you are in as root, then
Code:
echo $DISPLAY
If you su'ed into root, then you need to
Code:
xhost local:
before you do, and then
Code:
DISPLAY=:0.0
after you su into root
If none of this works, then please post the output of
Code:
echo $DISPLAY
and we'll star over
Last edited by slack1992man; 12-27-2008 at 02:56 PM.
But---"xwininfo -id <id>" does not want the display ID---it wants the window ID. I'm not getting why everyone's talking about $DISPLAY.
There is a -display option, but I assume that is to be used in conjunction with -id, -name, etc.
"Unable to open display" kicks out when X is not running or when the shell in use does not have access to an X screen. That was the purpose of my line of questioning. Lets see which it is.
I focused on the value of $DISPLAY as being the question, but maybe that was not the point you were asking.
Your use of xwininfo does indicate that you are not in an X session so there would be no meaningful value for $DISPLAY in that context...
And pixellany is correct, in an X environment as you used it, xwininfo wants the window ID, not the server ID...
So, as slack'92man said, let's start over and restate the question.
First, you stated that some things are not working, and I understand xwininfo to be an example of one that is not working? If that is correct, then the obvious question based on your output posted is:
Are you in an X session? ... then follow slack'92man's decision tree...
My system is set to boot directly into init 4; KDE 3.5; loggen in as normal user.
The root Konsole was started by:
"K menu--->system--->more applications--->terminal program - super user mode", rather than
"su" from the user Konsole
I followed the steps suggested by slack1992man; actually using two consoles - the super user console and the user console running "xhost local:" from the regular user console
and then setting "DISPLAY=:0.0" from the super-user console. xwininfo now works from the super-user console.
What started me into this was when I installed hplip; hp-setup defaults to a gui application that needs to be run with root privileges, but failed because it could not open a window. I ended up having to resort to the interactive setup. I've tried running a number of other things that needed root privileges but failed when the tried to open a window.
Thank you all for taking the time to try and educate me
I focused on the value of $DISPLAY as being the question, but maybe that was not the point you were asking.
Your use of xwininfo does indicate that you are not in an X session so there would be no meaningful value for $DISPLAY in that context...
Astrogeek, I did not see your post; yes, it took me all that time to prepare my 07:01PM post. The value of $DISPLAY was what I was looking for; Apparently I am/was completly clueless about what was going on.
Obviously, using "xwininfo" was a really bad example -- I wanted to keep my request for help generic and I came across "xwininfo" when an install of a perl mod failed - so I used that as an example
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.