[OT] how can a bash script determine if it's running in an xterm???

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Actually there are three states I want to base some conditional execution
on. 

I can do this now based on feeding the script a command-line argument.
But I'm wanting to have the script itself determine if:

1) It's running in a VT such as found in runlevel 3 or via ctrl+alt+F1
   in runlevel 5.

2) It's running in an "xterm", "konsole", "aterm", or (ANY other x based
   terminal window).

3) It's not attached to a terminal or VT (such as might happen if the
   script was called from alt+F2 run prompt).

How can a bash script test it's environment for these three different
conditions???

Please! and Thank you!

- -- 
|      ?           ?		
|			
|        -=-   -=-	 I'm NOT clueless...    	
|        <?>   <?>    	But I just don't know.  	
|            ^          Joe (theWordy) Philbrook           
|           ---  	     J(tWdy)P
|			  <jtwdyp@xxxxxxxx> 
|      ?           ?		


   ##############################################################
   # You can find my public gpg key at http://pgpkeys.mit.edu/  #
   ##############################################################

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFA7CmjRZ/61mwhY94RAqIUAKCRF3CfSOzgxiLvNkaGbgFHxx6YeQCgqk0h
36MV0/X9sU759G1775ar2YI=
=ToDr
-----END PGP SIGNATURE-----



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux