如何使用 GNOME Shell 扩展
GNOME 扩展

> 
> 简介：这是一份详细指南，我将会向你展示如何手动或通过浏览器轻松安装 GNOME Shell <ruby> 扩展 <rt>  Extension </rt></ruby>。
> 
> 
> 


![](/data/attachment/album/201803/15/105303c1zdtd1j7kttigdd.jpg)


在讨论 [如何在 Ubuntu 17.10 上安装主题](https://itsfoss.com/install-themes-ubuntu/) 一文时，我简要地提到了 GNOME Shell 扩展，它用来安装用户主题。今天，我们将详细介绍 Ubuntu 17.10 中的 GNOME Shell 扩展。


我可能会使用术语 GNOME 扩展而不是 GNOME Shell 扩展，但是这两者在这里具有相同的含义。


什么是 GNOME Shell 扩展？如何安装 GNOME Shell 扩展，以及如何管理和删除 GNOME Shell 扩展？我会一一解释所有的问题。


在此之前，如果你喜欢视频，我已经在 [FOSS 的 YouTube 频道](https://www.youtube.com/c/itsfoss?sub_confirmation=1) 上展示了所有的这些操作。我强烈建议你订阅它来获得更多有关 Linux 的视频。


### 什么是 GNOME Shell 扩展？


[GNOME Shell 扩展](https://extensions.gnome.org/) 根本上来说是增强 GNOME 桌面功能的一小段代码。


把它看作是你的浏览器的一个附加组件。例如，你可以在浏览器中安装附加组件来禁用广告。这个附加组件是由第三方开发者开发的。虽然你的 Web 浏览器默认不提供此项功能，但安装此附加组件可增强你 Web 浏览器的功能。


同样， GNOME Shell 扩展就像那些可以安装在 GNOME 之上的第三方附加组件和插件。这些扩展程序是为执行特定任务而创建的，例如显示天气状况、网速等。大多数情况下，你可以在顶部面板中访问它们。


![GNOME Shell 扩展显示天气信息](/data/attachment/album/201803/15/105328tt7fou008m7ut944.jpg)


也有一些 GNOME 扩展在顶部面板上不可见，但它们仍然可以调整 GNOME 的行为。例如，有一个这样的扩展可以让鼠标中键来关闭应用程序。


### 安装 GNOME Shell 扩展


现在你知道了什么是 GNOME Shell 扩展，那么让我们来看看如何安装它吧。有三种方式可以使用 GNOME 扩展：


* 使用来自 Ubuntu （或你的 Linux 发行版）的最小扩展集
* 在 Web 浏览器中查找并安装扩展程序
* 下载并手动安装扩展


在你学习如何使用 GNOME Shell 扩展之前，你应该安装 GNOME Tweak Tool。你可以在软件中心找到它，或者你可以使用以下命令：



```
sudo apt install gnome-tweak-tool

```

有时候，你需要知道你正在使用的 GNOME Shell 的版本，这有助于你确定扩展是否与系统兼容。你可以使用下面的命令来找到它：



```
gnome-shell --version

```

#### 1. 使用 gnome-shell-extensions 包 [最简单最安全的方式]


Ubuntu（以及其他几个 Linux 发行版，如 Fedora ）提供了一个包，这个包有最小集合的 GNOME 扩展。由于 Linux 发行版经过测试，所以你不必担心兼容性问题。


如果你不想费神，你只需获得这个包，你就可以安装 8-10 个 GNOME 扩展。



```
sudo apt install gnome-shell-extensions

```

你将需要重新启动系统（或者重新启动 GNOME Shell，我具体忘了是哪个）。之后，启动 GNOME Tweaks，你会发现一些扩展自动安装了，你只需切换按钮即可开始使用已安装的扩展程序。


![Change GNOME Shell theme in Ubuntu 17.1](/data/attachment/album/201803/15/105328u13ro3uow3orc5wb.jpg)


#### 2. 从 Web 浏览器安装 GNOME Shell 扩展


GNOME 项目有一个专门用于扩展的网站，不干别的，你可以在这里找到并安装扩展，并管理它们，甚至不需要 GNOME Tweaks Tool。


* [GNOME Shell Extensions Website](https://extensions.gnome.org/)


但是为了安装 Web 浏览器扩展，你需要两件东西：浏览器附加组件和本地主机连接器。


**步骤 1： 安装 浏览器附加组件**


当你访问 GNOME Shell 扩展网站时，你会看到如下消息：



> 
> “要使用此站点控制 GNOME Shell 扩展，你必须安装由两部分组成的 GNOME Shell 集成：浏览器扩展和本地主机消息应用。”
> 
> 
> 


![Installing GNOME Shell Extensions](/data/attachment/album/201803/15/105329dba5b7c70zgkyp5b.jpg)


你只需在你的 Web 浏览器上点击建议的附加组件链接即可。你也可以从下面的链接安装它们：


* 对于 Google Chrome、Chromium 和 Vivaldi： [Chrome Web 商店](https://chrome.google.com/webstore/detail/gnome-shell-integration/gphhapmejobijbbhgpjhcjognlahblep)
* 对于 Firefox： [Mozilla Addons](https://addons.mozilla.org/en/firefox/addon/gnome-shell-integration/)
* 对于 Opera： [Opera Addons](https://addons.opera.com/en/extensions/details/gnome-shell-integration/)


**步骤 2： 安装本地连接器**


仅仅安装浏览器附加组件并没有帮助。你仍然会看到如下错误：



> 
> “尽管 GNOME Shell 集成扩展正在运行，但未检测到本地主机连接器。请参阅文档以获取有关安装连接器的信息。”
> 
> 
> 


![How to install GNOME Shell Extensions](/data/attachment/album/201803/15/105330tx3hptbrx55h5i1i.jpg)


这是因为你尚未安装主机连接器。要做到这一点，请使用以下命令：



```
sudo apt install chrome-gnome-shell

```

不要担心包名中的 “chrome” 前缀，它与 Chrome 无关，你无需再次安装 Firefox 或 Opera 的单独软件包。


**步骤 3： 在 Web 浏览器中安装 GNOME Shell 扩展**


一旦你完成了这两个要求，你就可以开始了。现在，你将看不到任何错误消息。


![GNOME Shell Extension](/data/attachment/album/201803/15/105330e5v6j7bu4j45b6ki.jpg)


一件好的做法是按照 GNOME Shell 版本对扩展进行排序，但这不是强制性的。这是因为开发人员是为其当前的 GNOME 版本创建的扩展。而在一年之内，会发布两个或更多 GNOME 发行版本，但开发人员没有时间（在新的 GNOME 版本上）测试或更新他/她的扩展。


因此，你不知道该扩展是否与你的系统兼容。尽管扩展已经存在很长一段时间了，但是有可能在最新的 GNOME Shell 版本中，它也能正常工作。同样它也有可能不工作。


你也可以去搜索扩展程序。假设你想要安装有关天气的扩展，只要搜索它并选择一个搜索结果即可。


当你访问扩展页面时，你会看到一个切换按钮。


![Installing GNOME Shell Extension ](/data/attachment/album/201803/15/105331kyj02ctsefq5xbr5.jpg)


点击它，你会被提示是否要安装这个扩展：


![Install GNOME Shell Extensions via web browser](/data/attachment/album/201803/15/105331qilcu77jgl7xjz7j.jpg)


显然，直接安装就好。安装完成后，你会看到切换按钮已打开，旁边有一个设置选项。你也可以使用设置选项配置扩展，也可以禁用扩展。


![Configuring installed GNOME Shell Extensions](/data/attachment/album/201803/15/105332jo6xzjc1xf9o8l7c.jpg)


你也可以在 GNOME Tweaks Tool 中配置通过 Web 浏览器安装的扩展：


![GNOME Tweaks to handle GNOME Shell Extensions](/data/attachment/album/201803/15/105333rrgd8dk8bbertiz3.jpg)


你可以在 GNOME 网站中 [已安装的扩展部分](https://extensions.gnome.org/local/) 下查看所有已安装的扩展。


![Manage your installed GNOME Shell Extensions](/data/attachment/album/201803/15/105336drzby5d00vttjt38.jpg)


使用 GNOME 扩展网站的一个主要优点是你可以查看扩展是否有可用的更新，你不会在 GNOME Tweaks 或系统更新中得到更新（和提示）。


#### 3. 手动安装 GNOME Shell 扩展


你不需要始终在线才能安装 GNOME Shell 扩展，你可以下载文件并稍后安装，这样就不必使用互联网了。


去 GNOME 扩展网站下载最新版本的扩展。


![Download GNOME Shell Extension](/data/attachment/album/201803/15/105337xtikyv2llvyjlzf2.jpg)


解压下载的文件，将该文件夹复制到 `~/.local/share/gnome-shell/extensions` 目录。到主目录下并按 `Ctrl+H` 显示隐藏的文件夹，在这里找到 `.local` 文件夹，你可以找到你的路径，直至 `extensions` 目录。


一旦你将文件复制到正确的目录后，进入它并打开 `metadata.json` 文件，寻找 `uuid` 的值。


确保该扩展的文件夹名称与 `metadata.json` 中的 `uuid` 值相同。如果不相同，请将目录重命名为 `uuid` 的值。


![Manually install GNOME Shell extension](/data/attachment/album/201803/15/105337j5wm799el6lezyig.jpg)


差不多了！现在重新启动 GNOME Shell。 按 `Alt+F2` 并输入 `r` 重新启动 GNOME Shell。


![Restart GNOME Shell](/data/attachment/album/201803/15/105338ilbx3yp78elofyl0.jpg)


同样重新启动 GNOME Tweaks Tool。你现在应该可以在 Tweaks Tool 中看到手动安装的 GNOME 扩展，你可以在此处配置或启用新安装的扩展。


这就是安装 GNOME Shell 扩展你需要知道的所有内容。


### 移除 GNOME Shell 扩展


你可能想要删除一个已安装的 GNOME Shell 扩展，这是完全可以理解的。


如果你是通过 Web 浏览器安装的，你可以到 [GNOME 网站的以安装的扩展部分](https://extensions.gnome.org/local/) 那移除它（如前面的图片所示）。


如果你是手动安装的，可以从 `~/.local/share/gnome-shell/extensions` 目录中删除扩展文件来删除它。


### 特别提示：获得 GNOME Shell 扩展更新的通知


到目前为止，你已经意识到除了访问 GNOME 扩展网站之外，无法知道更新是否可用于 GNOME Shell 扩展。


幸运的是，有一个 GNOME Shell 扩展可以通知你是否有可用于已安装扩展的更新。你可以从下面的链接中获得它：


* [Extension Update Notifier](https://extensions.gnome.org/extension/1166/extension-update-notifier/)


### 你如何管理 GNOME Shell 扩展？


我觉得很奇怪不能通过系统更新来更新扩展，就好像 GNOME Shell 扩展不是系统的一部分。


如果你正在寻找一些建议，请阅读这篇文章： [关于最佳 GNOME 扩展](https://itsfoss.com/best-gnome-extensions/)。同时，你可以分享有关 GNOME Shell 扩展的经验。你经常使用它们吗？如果是，哪些是你最喜欢的？




---


via: <https://itsfoss.com/gnome-shell-extensions/>


作者：[Abhishek Prakash](https://itsfoss.com/author/abhishek/) 译者：[MjSeven](https://github.com/MjSeven) 校对：[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)

**Brief: This is a detailed guide showing you how to install GNOME Shell Extensions manually or easily via a browser.**

While discussing [how to install themes in Ubuntu](https://itsfoss.com/install-themes-ubuntu/), I briefly mentioned GNOME Shell Extension. It was used to enable user themes. Today, we’ll have a detailed look at GNOME Shell Extensions in Ubuntu and other Linux distributions.

I may use the term GNOME Extensions instead of GNOME Shell Extensions but both have the same meaning here.

In this tutorial, I’ll explain the following:

- What are GNOME Shell Extensions?
- How to install GNOME Shell Extensions?
- How to manage and remove GNOME Shell Extensions?

## What is a GNOME Shell Extension?

A [GNOME Shell Extension](https://extensions.gnome.org/?ref=itsfoss.com) is basically a tiny piece of code that enhances the capability of the GNOME desktop. Think of it as an add-on in your browser. Just as a browser add-on adds additional features to the browser, the GNOME extension adds additional features to the GNOME desktop environment.

For example, you can install an add-on in your browser to disable ads. This add-on is developed by a third-party developer. Though your web browser doesn’t provide it by default, installing this add-on enhances the capability of your web browser.

Similarly, GNOME Shell Extensions are like those third-party add-ons and plugins that you can install on top of GNOME. These extensions are created to perform specific tasks such as displaying weather conditions, internet speed, etc. Mostly, you can access them in the top panel.

![gnome weather extension](https://itsfoss.com/content/images/wordpress/2022/12/gnome-weather-extension.png)

There are also GNOME Extensions that are not visible in the top panel. But they still tweak GNOME’s behavior. For example, the middle mouse button can be used to close an application with one such extension.

## Installing GNOME Shell Extensions

Now that you know what GNOME Shell Extensions are, let’s see how to install them.

There are three ways you can use GNOME Extensions:

- Use a minimal set of extensions from Ubuntu (or your Linux distribution)
- Find and install extensions in your web browser
- Install extensions using Extension Manager App
- Download and manually install extensions

Although GNOME Tweaks is not required for extensions to work, [installing GNOME Tweak Tool in Ubuntu](https://itsfoss.com/gnome-tweak-tool/) or whichever distribution you are using is better.

`sudo apt install gnome-tweaks`


At times, you would also need to know the version of GNOME Shell you are using. This helps determine whether an extension is compatible with your system. You can use the command below to find it:

`gnome-shell --version`


### Method 1: Use the gnome-shell-extensions package

Ubuntu (and several other Linux distributions such as Fedora) provide a package with a minimal set of GNOME extensions. You don’t have to worry about compatibility here as it is tested by your Linux distribution.

If you want a no-brainer, just get this package and you’ll have 8-10 GNOME extensions installed.

`sudo apt install gnome-shell-extensions`


Once installed, log out and re-login to your system. After that, start GNOME Extensions App from Overview. This extensions app will be installed as part of `gnome-shell-extensions`

package.

![gnome extensions app in activities overview](https://itsfoss.com/content/images/wordpress/2022/12/gnome-extensions-app-in-activities-overview.png)

You’ll find a few extensions installed. You can just toggle the button to start using an installed extension.

![extensions installed using package manager](https://itsfoss.com/content/images/wordpress/2022/12/extensions-installed-using-package-manager.png)

### Method 2: Install GNOME Shell extensions from a web browser

The GNOME project has an entire website dedicated to extensions. That’s not it. You can find, install, and manage your extensions on this website itself. No need even for the GNOME Extensions app.

But to install extensions through a web browser, you need a browser add-on and a native host connector in your system.

#### Step 1: Install a browser add-on

When you visit the [GNOME Shell Extensions website](https://extensions.gnome.org/?ref=itsfoss.com), you’ll see a message like this:

“To control GNOME Shell extensions using this site you must install GNOME Shell integration that consists of two parts: browser extension and native host messaging application.”

![install gnome extensions add on notification in firefox browser](https://itsfoss.com/content/images/wordpress/2022/12/install-gnome-extensions-add-on-notification-in-firefox-browser.png)

You can simply click on the suggested add-on link in your web browser.

#### Step 2: Install a native connector

Just installing a browser add-on won’t help you. You’ll still see an error like this:

“No such native application org.gnome.chrome_gnome_shell”

![no gnome shell native connector](https://itsfoss.com/content/images/wordpress/2022/12/no-gnome-shell-native-connector.png)

This is because you haven’t installed the host connector yet. There is [chrome-gnome-shell](https://wiki.gnome.org/Projects/GnomeShellIntegration/Installation?ref=itsfoss.com) to help you. To install it, use this command:

`sudo apt install chrome-gnome-shell`


Don’t worry about the ‘chrome’ prefix in the package name. It has nothing to do with Chrome. You don’t have to install a separate package for Firefox or Opera here.

Also, **for Arch Linux users, the package in AUR has been changed** to ** gnome-browser-connector**. So, you can install it with your favorite AUR helper.

`yay -S gnome-browser-connector`


#### Step 3: Installing GNOME Shell Extensions in the web browser

Once you have completed these two requirements, you are all set to roll. Now when you go to the [GNOME Extension website](https://extensions.gnome.org/?ref=itsfoss.com), you won’t see any error message.

![you can sort the extensions according to your current gnome version which is the default set criteria for sort](https://itsfoss.com/content/images/wordpress/2022/12/you-can-sort-the-extensions-according-to-your-current-gnome-version-which-is-the-default-set-criteria-for-sort.png)

A good thing to do would be to sort the extensions by your GNOME Shell version. It is not mandatory though. What happens here is that a developer creates an extension for the present GNOME version. In one year, there will be two more GNOME releases. But the developer didn’t have time to test or update his/her extension.

As a result, you wouldn’t know if that extension is compatible with your system or not. The extension may work fine even in the newer GNOME Shell version despite that the extension is years old. It is also possible that the extension doesn’t work in the newer GNOME Shell.

You can search for an extension as well. Let’s say you want to install a weather extension. Just search for it and go for one of the search results.

When you visit the extension page, you’ll see a toggle button.

![toggle on the button in the extensions page to install an extension](https://itsfoss.com/content/images/wordpress/2022/12/toggle-on-the-button-in-the-extensions-page-to-install-an-extension.png)

Toggle the button to enable or disable GNOME Shell Extensions

Click on it and you’ll be prompted if you want to install this extension:

![press install to install the extension](https://itsfoss.com/content/images/wordpress/2022/12/press-install-to-install-the-extension.webp)

Obviously, go for Install here. Once installed, you’ll see that the toggle button is now on and a setting option is available next to it. You can configure the extension using the setting option. You can also disable the extension from here.

![manage your extensions through gnome extensions website](https://itsfoss.com/content/images/wordpress/2022/12/manage-your-extensions-through-gnome-extensions-website.png)

You can also configure the settings of an extension that you installed via the web browser in the GNOME Extensions App:

![manage installed gnome extensions through gnome extensions application](https://itsfoss.com/content/images/wordpress/2022/12/manage-installed-gnome-extensions-through-gnome-extensions-application.png)

You can see all your installed extensions on the website under the [installed extensions section](https://extensions.gnome.org/local/?ref=itsfoss.com). You can also delete the extensions that you installed via the web browser here.

![installed extensions listed in gnome extensions website](https://itsfoss.com/content/images/wordpress/2022/12/installed-extensions-listed-in-gnome-extensions-website.png)

One significant advantage of using the GNOME Extensions website is that you can see if there is an update available for an extension.

### Method 3: Install GNOME Shell Extensions using the Extension Manager application

There is a dedicated application called [GNOME Shell Extension Manager](https://github.com/mjakeman/extension-manager?ref=itsfoss.com) to browse, install and manage your extensions. This application avoids the need for a web browser.

By default, it will not be installed on your system. So you can install this application through the command:

`sudo apt install gnome-shell-extension-manager`


If you are using Arch Linux, it is [available in AUR](https://aur.archlinux.org/packages/extension-manager?ref=itsfoss.com).

There is a known issue with this application as of now. Updates do not work out of the box on GNOME 40 and certain older versions of GNOME 41 and 42 **unless the official GNOME Extensions app is also installed.** There is a workaround for this issue, and you can refer to [their Wiki for the same](https://github.com/mjakeman/extension-manager/wiki/Known-Issue:-Updates?ref=itsfoss.com).

Now, search for the extension manager in Activities Overview and open the Extension-Manager app.

![open gnome extension manager app from activities overview](https://itsfoss.com/content/images/wordpress/2022/12/open-gnome-extension-manager-app-from-activities-overview.png)

Inside the application, you can see the recommended extensions on the browse page. Search for extensions inside this browse page, and install those you want.

![install extensions using extension manager app](https://itsfoss.com/content/images/wordpress/2022/12/install-extensions-using-extension-manager-app.png)

### Method 4: Install GNOME Shell Extensions manually (for intermediate to advanced users)

It’s not that you have to be always online to install GNOME Shell extensions. You can download and install the files later, without needing the internet.

Go to GNOME Extensions website and download the extension with the latest version. The download will automatically start once you select the required shell and the extension version.

![provide shell version and extension version to download that particular version of the extension](https://itsfoss.com/content/images/wordpress/2022/12/provide-shell-version-and-extension-version-to-download-that-particular-version-of-the-extension.png)

Extract the downloaded file. Copy the folder to `~/.local/share/gnome-shell/extensions`

directory. Go to your Home directory and press Crl+H to show hidden folders. Locate the .local folder, and you can find your path to the extensions directory.

![copy the extracted extension folder to the extensions directory](https://itsfoss.com/content/images/wordpress/2022/12/copy-the-extracted-extension-folder-to-the-extensions-directory.png)

Once you have the files copied into the correct directory, go inside it and open the metadata.json file. Look for the value of `uuid`

.

Make sure that the name of the extension’s folder is the same as the value of uuid in the metadata.json file. If not, rename the directory to the value of this uuid.

![rename the extension folder according to uuid in metadata json file](https://itsfoss.com/content/images/wordpress/2022/12/rename-the-extension-folder-according-to-uuid-in-metadata-json-file.png)

The name of the extension folder should be the same as uuid.

Almost there! Now restart GNOME Shell. Press Alt+F2 and enter `r`

to restart GNOME Shell.

![restart gnome shell](https://itsfoss.com/content/images/wordpress/2022/12/restart-gnome-shell.png)

Restart the extensions app and you should see the manually installed GNOME extension there now. You can configure or enable the newly installed extension here.

![manually installed extension in gnome extensions app](https://itsfoss.com/content/images/wordpress/2022/12/manually-installed-extension-in-gnome-extensions-app.png)

And that’s all you need to know about installing GNOME Shell Extensions.

## Remove GNOME Shell Extensions

Understandably, you might want to remove an installed GNOME Shell Extension.

If you installed it via a web browser, you can go to the [installed extensions section on the GNOME website](https://extensions.gnome.org/local/?ref=itsfoss.com) and remove it from there (as shown in an earlier picture). Or you can remove it from the Extension App or Extension-Manager app.

Note that, only extensions installed either using the extensions app or through the browser can be removed using the browser or app. Any extension installed through package managers should be removed by uninstalling it using the respective package managers.

![remove manually installed extensions using extensions app](https://itsfoss.com/content/images/wordpress/2022/12/remove-manually-installed-extensions-using-extensions-app.png)

Or if you installed it manually, you can remove it by deleting the extension files from the `~/.local/share/gnome-shell/extensions`

directory.

## Bonus Tip: Get notified of GNOME Shell Extensions updates

GNOME Shell extensions that are installed on your system will get updates via the GNOME Shell Extension Manager app. Upon login to your system, the extensions that have updates to install will prompt notification for updates.

![notification about an available update for an extension](https://itsfoss.com/content/images/wordpress/2022/12/notification-about-an-available-update-for-an-extension.png)

Opening the notification will bring you to the extension app. It will make the update ready and you need to log out and re-login to apply the updates.

![extension app suggest a logout to install the update](https://itsfoss.com/content/images/wordpress/2022/12/extension-app-suggest-a-logout-to-install-the-update.png)

Also, there is a GNOME Shell Extension called **Extension List** that helps you manage your installed extensions and is accessible from the top panel.

![extension list a gnome extension to manage your installed extensions](https://itsfoss.com/content/images/wordpress/2022/12/extension-list-a-gnome-extension-to-manage-your-installed-extensions.png)

You can get it from the link below:

## How do you manage GNOME Shell Extensions?

I find it rather weird that you cannot update the extensions via the system updates. It’s as if GNOME Shell extensions are not even part of the system.

If you are looking for some recommendations, read this article about the [best GNOME extensions](https://itsfoss.com/best-gnome-extensions/).

[Top 20 GNOME Extensions You Should Be Using Right NowBrief: You can enhance the capacity of your GNOME desktop with extensions. Here, we list the best GNOME shell extensions to save you the trouble of finding them on your own. GNOME extensions are a major part of the GNOME experience. These extensions add a lot of value to the](https://itsfoss.com/best-gnome-extensions/)![](https://itsfoss.com/content/images/wordpress/2022/03/best-gnome-extensions-ft.png)


![](https://itsfoss.com/content/images/wordpress/2022/03/best-gnome-extensions-ft.png)

At the same time, share your experience with GNOME Shell extensions. Do you often use them? If yes, which ones are your favorite?