as the title:
How can I find which desktop environment I am using?
I want to accomplish this using command line.
as the title:
How can I find which desktop environment I am using?
I want to accomplish this using command line.
And you can try $DESKTOP_SESSION
for the DE.
gnome
, but it is ubuntu
, why?
– Yishu Fang
Apr 25 '12 at 14:38
$DESKTOP_SESSION
returns the Window Manager
(that's why it returns Ubuntu
), for the original question the correct answer is $XDG_CURRENT_DESKTOP
as indicated in the previous comment
– Manuel Jordan
Nov 27 '21 at 14:40
This command seems to be useful:
ls /usr/bin/*session
/usr/bin/gnome-session
(and more)/usr/bin/mate-session
(and more)/usr/bin/lxsession
(and more)/usr/bin/icewm-session
(should be jwm-session, not?!)I've tested the best tools I've found with:
a - GNOME under Linux Mint installed
b - GNOME under Linux Mint Live USB
c - MATE under Linux Mint
d - LXDE under Lubuntu
e - JWM under Puppy Linux (JWM is not a desktop environment but a stacking window manager).
f - XFCE under Debian Buster
env | grep DESKTOP_SESSION=
(so-so)
a & b - DESKTOP_SESSION=gnome
c - DESKTOP_SESSION=default.desktop
d - DESKTOP_SESSION=Lubuntu
e - Nothing
f - DESKTOP_SESSION=xfce
echo $GDMSESSION
(so-so)
a & b - gnome
c - Nothing
d - Lubuntu
e - Nothing
f - xfce
pgrep -l "gnome|kde|mate|cinnamon|lxde|xfce|jwm"
or ps -A | egrep -i "gnome|kde|mate|cinnamon|lxde|xfce|jwm"
(well, but not perfect)
a & b - OK
c - OK
d - WRONG
e - Nothing & OK
f - OK
HardInfo
(very well, but not perfect)
a - Nothing
b - GNOME 2.32.0
c - MATE
d - LXDE (Lubuntu)
e - Unknown (Window Manager: JWM)
f - XFCE
A combination of HardInfo
and the command ps -A | egrep -i "gnome|kde|mate|cinnamon|lxde|xfce|jwm"
probably will give the desired answer.
DESKTOP_SESSION=default
so for me the answer from @Nadew above worked
– Till Kolditz
Mar 27 '19 at 09:21
env | grep XDG_CURRENT_DESKTOP
says what i need.
– PHP Learner
Aug 09 '19 at 04:17
gnome-terminal
as terminal app. I also have kmag installed. Running ps/pgrep I get false positives for kdevtmpfs
and gnome-keyring-daemon
even tho gnome & kde are not installed.
– zpangwin
Apr 20 '21 at 16:39
ls -acl /usr/bin/*session
) or presence of file managers (e.g. test 1 == $(which nemo 2>/dev/null|wc -l)
). Other options not listed in the older answer might also be useful such as : sudo grep -i session /var/lib/AccountsService/users/$USER
or grep PREFERRED /etc/sysconfig/desktop
but I am not sure how consistently those are used across distros
– zpangwin
Apr 20 '21 at 16:49
For the window manager you can use:
sudo apt-get install wmctrl
wmctrl -m | grep "Name:" | awk '{print $2}'
window manager
is a own issue compared to the desktop env
, please correct if I am wrong.
– Timo
May 16 '21 at 06:37
In a terminal or console, you can run:
pgrep -l "gnome|kde|mate|cinnamon"
or
ps -A | egrep -i "gnome|kde|mate|cinnamon"
The item that appears in more lines should be the answer
31 kdevtmpfs
, 2026 gnome-keyring-d
, 2201 polkit-gnome-au
, and I'm on xfce.
– Klesun
Apr 26 '19 at 12:51
You can run HardInfo. It's ready by default at least in Linux Mint; or you could install it (from Synaptic, ...).
You can run it a) from the main menu > Search box > hardinfo, or b) from the main menu > All applications > System Tools or Administration > System Information, or c) from the main menu > All applications > All > System Information, or d) from a terminal or console > hardinfo > Enter, or e) from the Run Application dialog (Alt+F2) > hardinfo > Enter.
Once HardInfo opens you just need to need to click on the "Operating System" item and look to the "Desktop Environment" line.
Nowadays, apart from GNOME and KDE, you could find MATE, Cinnamon, ...
sudo apt-get install hardinfo
on debian. It identified my desktop environment as XFCE 4.
– Josiah Yoder
Sep 13 '18 at 12:59
grep cdrom: /etc/apt/sources.list | sed -n '1s|.*deb cdrom:\[\([^ ]* *[^ ]*\).*|\1|p'
– Marnix A. van Ammers Jul 31 '13 at 23:30