如何找出你所使用的桌面环境
桌面环境 GNOME
如果你是 Linux 新用户，并在一个 Linux 论坛中寻求帮助，那么你可能会被问以下问题：



> 
> “你使用的是哪个桌面环境？”
> 
> 
> 


你知道什么是<ruby> 桌面环境 <rt>  desktop environment </rt></ruby>（DE），但你如何知道你使用的是哪一个？我会告诉你如何找到它。我将首先展示命令行方法，因为这适用于[各种 Linux 发行版](https://itsfoss.com/what-is-linux/)。我还将展示如何通过图形方式获得。


### 检查你使用的是哪个桌面环境


![](/data/attachment/album/202004/18/205519b7n0ibnmhthxiivy.jpg)


你可以[在 Linux 中使用 echo 命令](https://linuxhandbook.com/echo-command/)在终端中显示 `XDG_CURRENT_DESKTOP` 变量的值。


打开终端并复制粘贴此命令：



```
echo $XDG_CURRENT_DESKTOP
```

例如，这表明我在 [Ubuntu 20.04](https://itsfoss.com/ubuntu-20-04-release-features/) 中使用了 [GNOME 桌面](https://www.gnome.org/)：



```
[email protected]:~$ echo $XDG_CURRENT_DESKTOP
ubuntu:GNOME
```

尽管此命令可以快速告诉你正在使用哪个桌面环境，但它不会提供任何其他信息。


在某些情况下，了解桌面环境版本可能很重要。软件的每个新版本都会带来新功能或删除某些功能。[GNOME 3.36](https://itsfoss.com/gnome-3-36-release/) 引入了“请勿打扰”选项，以关闭所有桌面通知。


假设你了解了这个新的“请勿打扰”功能。你确认自己正在使用 GNOME，但是在 GNOME 桌面上看不到此选项。如果你可以检查系统上已安装的 GNOME 桌面版本，那么这会很清楚。


我将先向你展示命令检查桌面环境版本，因为你可以在任何运行桌面环境的 Linux 中使用它。


### 如何获取桌面环境版本


与获取桌面环境的名称不同。获取其版本号的方法并不直接，因为它没有标准的命令或环境变量可以提供此信息。


在 Linux 中获取桌面环境信息的一种方法是使用 [Screenfetch](https://github.com/KittyKatt/screenFetch) 之类的工具。此[命令行工具以 ascii 格式显示 Linux 发行版的 logo](https://itsfoss.com/display-linux-logo-in-ascii/) 以及一些基本的系统信息。桌面环境版本就是其中之一。


在基于 Ubuntu 的发行版中，你可以通过[启用 Universe 仓库](https://itsfoss.com/ubuntu-repositories/)安装 Screenfetch，然后使用以下命令：



```
sudo apt install screenfetch
```

对于其他 Linux 发行版，请使用系统的软件包管理器来安装此程序。


安装后，只需在终端中输入 `screenfetch` 即可，它应该显示桌面环境版本以及其他系统信息。


![Check Desktop Environment Version](/data/attachment/album/202004/18/205520cg5yfua5ifgfgzfg.jpg)


如上图所示，我的系统使用 GNOME 3.36.1（基本版本是 GNOME 3.36）。你也可以这样[检查 Linux 内核版本](https://itsfoss.com/find-which-kernel-version-is-running-in-ubuntu/)和其他详细信息。


请记住，Screenfetch 不一定显示桌面环境版本。我查看了它的源码，它有许多 if-else 代码，可以从各种桌面环境中的许多源和参数获取版本信息。如果找不到任何版本，那么仅显示桌面环境名称。


### 使用 GUI 检查桌面环境版本


几乎所有桌面环境在其 “Settings”->“About” 部分中都提供了基本的系统详细信息。


一个主要问题是，大多数桌面环境看起来都不同，因此我无法展示每个桌面环境的确切步骤。我将展示 GNOME 的，让你在桌面上发现它。


在菜单中搜索 “Settings”（按 Windows 键并搜索）：


![Search for Settings application](/data/attachment/album/202004/18/205521twtrw2rf8y2x64hg.jpg)


在这里，找到底部的 “About” 部分。单击它，你应该就能看到桌面环境及其版本。


![Check Desktop Environment in Ubuntu](/data/attachment/album/202004/18/205524guhx8aobcn887m8o.jpg)


如你所见，这表明我的系统正在使用 GNOME 3.36。


我希望这个快速入门技巧对你有所帮助。如果你有任何疑问或建议，请在下面发表评论。




---


via: <https://itsfoss.com/find-desktop-environment/>


作者：[Abhishek Prakash](https://itsfoss.com/author/abhishek/) 选题：[lujun9972](https://github.com/lujun9972) 译者：[geekpi](https://github.com/geekpi) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
![Warp Terminal](/assets/images/warp-terminal.webp)


![Warp Terminal](/assets/images/warp-terminal.webp)

If you are a new Linux user and seeking help in one of the Linux forums, you may be asked this question:

*“Which desktop environment are you using?”*

You have an idea about [what a desktop environment is](https://itsfoss.com/what-is-desktop-environment/) but how do you know which one are you using? I’ll tell you how to find it out. I’ll show the command line method first because that is applicable to [all kind of Linux distributions](https://itsfoss.com/what-is-linux/). I’ll also show the graphical way of getting this information.

## Check which desktop environment you are using

You can [use the echo command in Linux](https://linuxhandbook.com/echo-command/) to display the value of XDG_CURRENT_DESKTOP variable in the terminal.

Open the terminal and copy paste this command:

`echo $XDG_CURRENT_DESKTOP`


For example, it shows that I am using [GNOME desktop](https://www.gnome.org/) in [Ubuntu 20.04](https://itsfoss.com/ubuntu-20-04-release-features/):

```
abhishek@itsfoss:~$ echo $XDG_CURRENT_DESKTOP
ubuntu:GNOME
```


While this command quickly tells you which desktop environment is being used, it doesn’t give any other information.

Knowing the version of desktop environment (also called DE) could be important in some cases. Each new version of a software brings new features or removes some. [GNOME 3.36](https://itsfoss.com/gnome-3-36-release/) introduces a ‘Do Not Disturb’ option to toggle off all the desktop notifications.

Suppose you read about this new Do Not Disturb feature. You verify that you are using GNOME and yet you don’t see this option in your GNOME desktop. If you could check the GNOME desktop version you have installed on your system, that could make things clear for you.

I’ll show you the commands to check the desktop environment’s version first because you can use it in any Linux, running desktop environment.

## How to get desktop environment version

Unlike getting the name of desktop environment. getting its version number is not straightforward because there is no standard command or environment variable that could give this information.

One way to get the desktop environment information in Linux is by using a tool like [Screenfetch](https://github.com/KittyKatt/screenFetch). This [command line tool displays the logo of your Linux distribution in ascii format](https://itsfoss.com/display-linux-logo-in-ascii/) along with a few basic system information. Desktop environment version is one of them.

In Ubuntu based distributions, you can install Screenfetch by [enabling Universe repository](https://itsfoss.com/ubuntu-repositories/) and then using this command:

`sudo apt install screenfetch`


For other Linux distributions, please use your system’s package manager to install this program.

Once installed, simply type screenfetch in the terminal and it should show the desktop environment version along with other system information.

![Check Desktop Environment Version](https://itsfoss.com/content/images/wordpress/2020/04/check-desktop-environment-version.jpg)

As you can see in the above image, my system is using GNOME 3.36.1 (basically GNOME 3.36). You can also [check the Linux kernel version](https://itsfoss.com/find-which-kernel-version-is-running-in-ubuntu/) and other details here.

Please keep in mind that it is not guaranteed that Screenfetch will display the desktop environment version. I checked its source code and it has lots of if-else code to get the version information from a number of sources and parameters in various desktop environments. If it can find nothing on version, it just displays the DE name.

## Using GUI to check desktop environment version

Almost all desktop environments provide basic system details in their Settings-About section.

The one major problem is that most DEs look different and thus I cannot show the exact steps for each of them. I am going to show it for GNOME and I let you discover it in your desktop.

So, search for Settings in the menu (press Windows key and search):

![Applications Menu Settings](https://itsfoss.com/content/images/wordpress/2019/08/applications_menu_settings.jpg)

In here, go to the bottom to find the About section. Click on it and you should have the desktop environment along with its version.

![Check Desktop Environment Ubuntu](https://itsfoss.com/content/images/wordpress/2020/04/check-desktop-environment-ubuntu.jpg)

As you can see, it shows that my system is using GNOME 3.36.

## Which DE are you using?

Similarly, you can find out whether you are using Wayland or Xorg display server.

[How to Check if You are Using Wayland or Xorg?There is a technical transition taking place in the desktop Linux world. Most mainstream distros have started to move to the Wayland display server by default. But not all legacy components are compatible with the newer Wayland. They work only with the good old X or Xorg display server.…](https://itsfoss.com/check-wayland-or-xorg/)![](https://itsfoss.com/content/images/wordpress/2022/09/check-wayland-or-xorg.png)


![](https://itsfoss.com/content/images/wordpress/2022/09/check-wayland-or-xorg.png)

I hope you find this quick beginner tip useful. If you have questions or suggestions, please leave a comment below.