Is there a way to retrieve the desktop environment name (e.g. Gnome, Unity, XFCE, LXDE, KDE...) from the command line or using Python?
1 Answer
In a Terminal input:
echo $DESKTOP_SESSION
if it does not help (it may be equal 'default'), try
echo $XDG_CURRENT_DESKTOP
-
6Note that this will not always work as sometimes DESKTOP_SESSION is set to "Default" or in some cases not set at all (I think it's gdm/kdm that set this variable). A better approach would be to check for the running session process. Commented Aug 25, 2012 at 17:39
-
I noticed there's also a varable XDG_CURRENT_DESKTOP="LXDE" (or "Unity", in my two desktops), do you think it's reliable?– giuspenCommented Aug 26, 2012 at 8:58
-
1
-
@don_crissti - thanks I read in the other discussion that you linked that XDG_CURRENT_DESKTOP is deprecated. I will try to look at the running processes.– giuspenCommented Aug 26, 2012 at 14:50
-
@giuspen: On Xubuntu 13.04, I get
xubuntu
for$DESKTOP_SESSION
andXFCE
for$XDG_CURRENT_DESKTOP
. Commented May 30, 2013 at 7:19