Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Detect Environment

by Crackers2 (Parson)
on Dec 09, 2009 at 17:01 UTC ( #811968=note: print w/replies, xml ) Need Help??


in reply to Re: Detect Environment
in thread Detect Environment

Another option is to check if the DISPLAY env var is set, and open up graphical if it is.

I think that's the behaviour things like emacs use for example. It does mean that if you open a console from your GUI and then start the program from there, it'll open up with the GUI, which seems to be slightly different from what you describe although more intuitive.

(Update: "You" in the above means the OP of course, not almut)

Replies are listed 'Best First'.
Re^3: Detect Environment
by roboticus (Chancellor) on Dec 09, 2009 at 18:18 UTC

    Crackers2:

    FYI: It's a frequent case where you have a console window open on an XTerm. Then you'd be on a console, but you'd still have DISPLAY set.

    ...roboticus

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://811968]
help
Chatterbox?
[Corion]: Ouch. I just learned something about Chrome - the "version numbers" are not really feature numbers... Chrome 62 still gets new features even though Chrome 64 is out and Chrome 65 is the dev version
[erix]: why ouch? Something to be said for that ,surely?
LanX is a dev version
[marto]: That reminds me, I made some notes somewhere with regard W::M::C, I'll get round to a PR when I've time to flesh it out
[Corion]: erix: But that makes for fun bug hunting. "What version of Chrome are you running?" "v62". "I also run v62 and it works on my machine". :-(
[Corion]: marto: Great, looking forward to the PR!

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (9)
As of 2017-12-12 20:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (335 votes). Check out past polls.

    Notices?