1 |
Kevin O'Gorman wrote: |
2 |
|
3 |
>Is there a way for a script (bash, for instance) to know |
4 |
>if it's running under X, such as in an xterm or konsole? |
5 |
> |
6 |
>I want to have scripts that run graphical tools if the |
7 |
>infrastructure is present, and text tools otherwise. |
8 |
>For me this is particularly useful for tools I don't use |
9 |
>all that often, and can forget that a graphical version |
10 |
>exists. |
11 |
> |
12 |
>++ kevin |
13 |
> |
14 |
> |
15 |
> |
16 |
Another way would be to check ${TERM} - on a tty, its "linux", and in X |
17 |
it specifies the terminal emulator (rxvt, xterm, Eterm, etc.). |