I was wondering what commands/utilities can be used in terminal to know the types of windowing system (such as X window system), window manager (such as Metacity, KWin, Window Maker) and desktop environment (such as KDE, Gnome) of a Linux or other Unix-like operating systems?


  • 2
    So you want to know what's installed, what's default or what's running? – bahamat Feb 14 '11 at 16:14
  • @bahamat: what is running. That is why I want to know if there are some system files or commands for me to check that. But if you also know how to check for what's installed, what's default, then I also would like to know. Thanks! – Tim Feb 14 '11 at 17:49
  • What do you want to do with this information? (Windowing system is at least almost always X windows) – pjc50 Feb 15 '11 at 15:38
  • @pjc50: different types come with different sets of applications. I need the info to decide whether an application is for mine. – Tim Feb 15 '11 at 15:41
  • 1
    For desktop environment, I came across env | grep XDG_CURRENT_DESKTOP. – user15760 May 7 '13 at 17:41

From Ask Ubuntu.SE:

If you have wmctrl installed, wmctrl -m will identify the window manager for you.

Thomas already mentioned the XDG_CURRENT_DESKTOP environment variable for identifying the desktop environment.

And from this thread here in Unix & Linux SE: the XDG_SESSION_TYPE environment variable can be used to identify whether the windowing system is X11 or Wayland.


With difficulty.

There is no centralized system for keeping track of these things.

  • On Debian-derived Linuxes you might try the alternatives system.
  • You could query the package manager, and if you find only one Foo installed, you can be pretty sure which Foo is in use.
  • You could try parsing the output of ps. Or equivalently of reading /proc on systems that have it.

Possibly the most reliable thing is to ask the user.


One of the answers in the comments works for me in Kali (probably in other Debian-based distros as well)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.