I want to detect which desktop manager I am running, and I found out that there are three environment variables, DESKTOP_SESSION
, XDG_SESSION_DESKTOP
, and XDG_CURRENT_DESKTOP
which could help me do so. But what exactly is the difference between these three variables? Thanks in advance.
Linux – the difference between DESKTOP_SESSION, XDG_SESSION_DESKTOP, and XDG_CURRENT_DESKTOP
desktopenvironment-variablesguilinuxspecifications
Best Answer
I'm not sure what the official reasons are for having many different variables, most likely different window & display managers all do their own particular configurations.
But all of them look the same, so using any one should work...
Here's what Mint's XFCE has:
and also
Or (from
env
):Your best bet (if you've got
wmctrl
) may be this combined with grep/cut:You can also be using a different Window Manager and Display Manager, and some different distributions store data in different places, so confusion reigns supreme. See these very related Q's: