This question already has an answer here:
as the title:
How can I find which desktop environment I am using?
I want to accomplish this using command line.
I've tested the best tools I've found with:
a & b - DESKTOP_SESSION=gnome c - DESKTOP_SESSION=default.desktop d - DESKTOP_SESSION=Lubuntu e - Nothing
a & b - gnome c - Nothing d - Lubuntu e - Nothing
a & b - OK c - OK d - WRONG e - Nothing & OK
a - Nothing b - GNOME 2.32.0 c - MATE d - LXDE (Lubuntu) e - Unknown (Window Manager: JWM)
CONCLUSION: A combination of
This command seems to be useful:
-> in GNOME returns
-> in MATE returns
-> in LXDE returns
-> in JWM returns
In a terminal or console, you can run:
The item that appears in more lines should be the answer
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, ...
For the window manager you can use: