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

Re: Command used to view desktop envorinoment

On 9/10/06, Chhun Vanna <chhvanna gmail com> wrote:
Dear all
 any body can help me with linux command to view my current desktopn
 i just want to show m desktop is KDE or GNOME?
 I try to search with switchdesk command but it does not sounds what i want.

Chhun Vanna

The file /etc/sysconfig/desktop will contain either


Not sure if there is an environment variable for that (not in Linux
right now.  You could try "env", as well as "set" to see if either
have an environment variable showing which desktop you are using).

So you can at least get it from /etc/sysconfig/desktop.  If you want
to assign it to a variable, use:

mydesktop=$(cat /etc/sysconfig/desktop | grep DESKTOP | awk -F \= '{print $2}')

I'm assuming you are wondering about this because you want to have a
script do one thing if in Gnome, but something else if in KDE since
you are wondering if there is a Linux command to find out which
desktop you are using.

If you are simply looking to find out because you don't know which one
you are using, just do
cat /etc/sysconfig/desktop

and have a look at the output.

If nothing is specified, in Fedora Core at least I believe that means
the default Gnome desktop is the one being used currently.

Jacques B.

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