LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-27-2008, 01:20 PM   #1
garyg007
Member
 
Registered: Aug 2008
Location: north-east ohio
Distribution: Debian-squeeze/stable;
Posts: 279
Blog Entries: 1

Rep: Reputation: 31
environment variable "$DISPLAY"


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?

Thanks

Gary
 
Old 12-27-2008, 01:32 PM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,267
Blog Entries: 24

Rep: Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195
That is you X server display

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]

Last edited by astrogeek; 12-27-2008 at 01:45 PM.
 
Old 12-27-2008, 02:18 PM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Look at the man page for xwininfo. It wants the window ID, not the display ID

Try running xwininfo with no arguments.
 
Old 12-27-2008, 02:34 PM   #4
garyg007
Member
 
Registered: Aug 2008
Location: north-east ohio
Distribution: Debian-squeeze/stable;
Posts: 279

Original Poster
Blog Entries: 1

Rep: Reputation: 31
Quote:
Originally Posted by pixellany View Post
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.


Again, Thank you for the replies;

Gary
 
Old 12-27-2008, 02:54 PM   #5
slack1992man
LQ Newbie
 
Registered: Dec 2008
Location: NYC
Distribution: Slackware 12.2
Posts: 5

Rep: Reputation: 1
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.
 
Old 12-27-2008, 02:54 PM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Interesting-----On my system, running "xwininfo" with no arguments allows you to click on a window to get a dump of information.

Can you run "xwininfo -name foo"? (Replace "foo" with the name of a window as it appears in the title bar.)
 
Old 12-27-2008, 03:00 PM   #7
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
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.
 
Old 12-27-2008, 03:06 PM   #8
slack1992man
LQ Newbie
 
Registered: Dec 2008
Location: NYC
Distribution: Slackware 12.2
Posts: 5

Rep: Reputation: 1
Quote:
Originally Posted by pixellany View Post
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.
 
Old 12-27-2008, 03:22 PM   #9
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,267
Blog Entries: 24

Rep: Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195
HA! Yes, per slack'92man: let's start over...

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...

Last edited by astrogeek; 12-27-2008 at 03:24 PM.
 
Old 12-27-2008, 04:01 PM   #10
garyg007
Member
 
Registered: Aug 2008
Location: north-east ohio
Distribution: Debian-squeeze/stable;
Posts: 279

Original Poster
Blog Entries: 1

Rep: Reputation: 31
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

Gary
 
Old 12-27-2008, 07:29 PM   #11
garyg007
Member
 
Registered: Aug 2008
Location: north-east ohio
Distribution: Debian-squeeze/stable;
Posts: 279

Original Poster
Blog Entries: 1

Rep: Reputation: 31
Quote:
Originally Posted by astrogeek View Post
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

Thanks again

Gary
 
Old 12-27-2008, 07:46 PM   #12
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,267
Blog Entries: 24

Rep: Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195
You are welcome!

Quote:
Originally Posted by garyg007 View Post
Astrogeek, I did not see your post...
No problem, glad you got it figured out, and thanks for the courtesy of your reply!
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Environment variable gnome & "Run application" frado Linux - Desktop 0 08-16-2007 05:07 PM
"PKG_CONFIG_PATH environment variable" huh? plz help David_g17 Linux - Software 3 09-30-2004 06:33 PM
"MOZILLA_FIVE_HOME" environment variable cougyr Linux - Software 2 12-06-2003 11:51 PM
"set an environment variable" JMCraig Linux - Newbie 4 02-17-2003 04:24 PM
How can I do some modification to my initialized "env" environment variable? yuzuohong Linux - General 3 12-18-2002 03:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:21 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