Operating System - HP-UX
1823114 Members
3308 Online
109646 Solutions
New Discussion юеВ

Am I a text or graphics based window?

 
Barry O Flanagan
Respected Contributor

Am I a text or graphics based window?

Quick one and probably a simple one:

When logging in as a certain user I need to determine if I'm logging in from a standard VT type terminal or graphics capable X terminal. Theres probably many ways of doing this - any one have any nices ones?

Will 'ttytype' suffice?
3 REPLIES 3
Ravi_8
Honored Contributor

Re: Am I a text or graphics based window?

Hi,
if you issue the command 'env' you get the TERM type
never give up
Barry O Flanagan
Respected Contributor

Re: Am I a text or graphics based window?

Sorry Ravi, I should have mentioned - I'd like to be able to do it without referencing the TERM variable.... In otherwords, is there any way of querying the terminal itself to find out what it is? Hence my suggestion of ttytype (which I think just calls tset) ??
Bill McNAMARA_1
Honored Contributor

Re: Am I a text or graphics based window?

If you type
who am i
You can find your pty or tty
then
ps -ef | grep ty
to look for instances of hpterm, xterm or any other graphic env.. which would give it away.

who -R and who am i -R will give you the connecting IP address that a DISPLAY would/should be exported to in graphical env.
If you have a display set you are graphical.


Later,
Bill
It works for me (tm)