Check which desktop enviroment is the user using (Linux) in Qt
is it possible to check which desktop environment is the user is using (say KDE or Unity). The issue is that I have a window which has a menubar, but depending on the desktop environment, the menu is drawn on it or not (for example, in Unity, the menubar is drawn on the panel). I know that I could just disable the nativeMenuBar feature, but I would prefer to have it enabled. In my case, I cannot use layouts, so the only two options are to check the desktop enviroment or disable the nativeMenuBar feature.
Thanks in advance.
Answers
You can check the DESKTOP_SESSION environment variable. Use getenv() to do that.