How to Find Your Desktop Environment
In this article
To find your desktop environment, open a terminal and run echo $XDG_CURRENT_DESKTOP or echo $DESKTOP_SESSION. The output gives you the name directly, such as GNOME, KDE, XFCE, or MATE. If those variables are empty, check /etc/os-release or your login screen for clues. This guide walks through the reliable methods on Linux, plus how to identify the desktop environment on Windows and macOS if that is what you meant.
What You'll Need
- A Linux, Windows, or macOS computer you can use.
- Access to a terminal or command prompt (on Linux, any terminal emulator; on Windows, Command Prompt or PowerShell; on macOS, Terminal).
- Basic familiarity with typing commands and reading output.
Step-by-Step
- Open a terminal. On Linux, press
Ctrl+Alt+T(common on many distributions) or search for "Terminal" in your applications menu. On Windows, open Start and type "cmd" or "PowerShell". On macOS, open Launchpad and search for "Terminal". - Check the XDG_CURRENT_DESKTOP variable. Type
echo $XDG_CURRENT_DESKTOPand press Enter. This is the most standardized way to see the desktop environment name. It might return something likeGNOME,KDE,XFCE, orubuntu:GNOME. - Check the DESKTOP_SESSION variable. Type
echo $DESKTOP_SESSIONand press Enter. This often shows the session name, which can be more specific (e.g.,plasmafor KDE Plasma,gnomefor GNOME). Note that labels can differ slightly by distribution or version. - Look at the login screen. Before logging in, many display managers show a gear icon or a session menu. Clicking it lists available desktop environments. The one currently selected is likely the one you will use after logging in.
- Inspect the system information. Run
cat /etc/os-releaseto see the distribution name; some distributions bundle a specific desktop environment by default (e.g., Ubuntu uses GNOME, Kubuntu uses KDE Plasma). This is not definitive if you installed multiple environments, but it is a good hint. - Use a GUI tool if available. On many Linux systems, open Settings and look for an "About" or "System Information" page. It often lists the desktop environment under "OS Name" or "Graphics". The exact path varies: for example, on GNOME it is Settings > About; on KDE it is System Settings > About System.
- For Windows, identify the shell. Windows does not have a "desktop environment" in the Linux sense; the desktop is part of the operating system. To see your Windows version, press
Win+R, typewinver, and press Enter. The dialog shows the Windows edition and version. The desktop shell is Explorer.exe, which you can confirm in Task Manager under the Processes tab. - For macOS, check the version. Click the Apple menu and choose "About This Mac". The window shows the macOS name and version. The desktop environment is Aqua, which is built into macOS and not separately selectable.
Common Mistakes
- Confusing distribution with desktop environment. Ubuntu is a distribution; GNOME is its default desktop environment. You can change the desktop environment on many distributions.
- Assuming environment variables are always set. In some minimal or custom setups,
XDG_CURRENT_DESKTOPmay be empty. Fall back to other methods. - Running commands in the wrong shell. If you use a non‑Bash shell (like fish or zsh), the syntax for environment variables might differ. Use
printenv XDG_CURRENT_DESKTOPfor a shell‑agnostic approach. - Expecting a single answer on Windows or macOS. These systems have a fixed desktop shell; there is no equivalent to switching between GNOME and KDE.
Tips
- Use
printenv | grep -i desktopto list all environment variables containing "desktop" for a quick overview. - If you have multiple desktop environments installed, the login screen session menu is the easiest way to see which one you are about to launch.
- On Linux, the command
ls /usr/share/xsessions/lists installed desktop session files (e.g.,gnome.desktop,plasma.desktop). This shows what is available, not necessarily what is running. - For a more detailed report, install and run
inxi -S(if available) which prints system and desktop environment information.
Troubleshooting
If the environment variables return nothing, try logging out and back in, or open a new terminal window. Some variables are set only for graphical sessions. If you are on a remote SSH connection, the desktop environment variables may not be present because you are not in a graphical session. In that case, check the display manager configuration or ask the system administrator. If you suspect the desktop environment is not working correctly, try restarting the display manager (e.g., sudo systemctl restart gdm for GNOME, sudo systemctl restart sddm for KDE) — but note this will log you out and close all applications, so save your work first. On Windows, if Explorer.exe is not running, you will see a blank screen; press Ctrl+Shift+Esc to open Task Manager, then File > Run new task, type explorer.exe, and press Enter. On macOS, if the Finder is not responding, force quit it via the Apple menu > Force Quit, select Finder, and click Relaunch.
Frequently Asked Questions
How do I find my desktop environment on Linux?
Run echo $XDG_CURRENT_DESKTOP in a terminal. If that is empty, try echo $DESKTOP_SESSION or check your login screen's session menu.
Can I have more than one desktop environment installed?
Yes. Many Linux users install multiple environments and choose one at the login screen. The environment variables will reflect the one you are currently running.
What is the difference between a desktop environment and a window manager?
A desktop environment is a full suite (panel, file manager, settings, etc.), while a window manager only controls window placement and decorations. Some setups use a standalone window manager without a full desktop environment.
Does Windows have a desktop environment?
Not in the Linux sense. Windows has a built-in shell (Explorer) that provides the desktop, taskbar, and Start menu. You cannot swap it for GNOME or KDE.
How do I find the desktop environment on a Chromebook?
ChromeOS uses its own proprietary desktop environment. You can see the version in Settings > About ChromeOS. Linux (Crostini) runs in a container and typically uses a minimal environment, often without a full desktop environment unless you install one.
Why does echo $XDG_CURRENT_DESKTOP return nothing?
The variable may not be set in non‑graphical sessions (like SSH) or in some minimal setups. Try running the command in a terminal opened from your graphical desktop, or use printenv | grep -i desktop.