View Full Version : Howto determine the Desktop Environment
February 1st, 2008, 03:03 PM
Question: From within a C/C++ program, how do i determine the Desktop Environment (that is to say: is it Gnome or KDE or XFCE, or another)?
February 1st, 2008, 04:21 PM
February 1st, 2008, 05:13 PM
You can't really. There is another thread that looked at this issue in detail.
February 1st, 2008, 07:43 PM
This was discussed in thread http://ubuntuforums.org/showthread.php?t=652320
The range of possibilities is just too complicated to get a simple answer.
The X properties approach that I pointed to in the other thread works pretty well.
WM_WINDOW=$(xprop -root _NET_SUPPORTING_WM_CHECK);
WM_NAME=$(xprop -id $WM_WINDOW 8s _NET_WM_NAME)
echo $WM_NAME But when the window manager is beryl or compiz that may not match the question that you really wanted answered.
That kind of leads to the underlying question-
What does your program need to know about the environment that it can't react to with a portable standard mechanism?
February 1st, 2008, 11:18 PM
Thanks. I think i will use the process list.
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.