当前位置: 首页>>技术教程>>正文


如何在Ubuntu 18.04 Bionic Beaver Linux上使用命令行从ZIP文件安装Gnome Shell Extensions

, ,

目的

目的是在Ubuntu 18.04 Bionic Beaver Linux上使用命令行从ZIP文件安装Gnome Shell Extensions。使用命令行从ZIP文件安装Gnome Shell Extensions可被视为标准方式的替代方法。Gnome Shell扩展安装

操作系统和软件版本

  • 操作系统:-Ubuntu 18.04仿生海狸
  • 软件:-GNOME Shell 3.26.2或更高版本

要求

除了安装GNOME Shell外,没有特殊要求

约定

  • -要求linux命令可以直接以root用户身份或通过使用root特权以root特权执行sudo命令
  • $-要求linux命令以普通非特权用户身份执行

本教程的其他版本

Ubuntu 20.04(Focal Fossa)

使用说明

下载Gnome扩展

首先下载您要安装的Gnome扩展程序。例如,在本教程中,我们将安装开放天气侏儒扩展。打开终端并检查您的Gnome Shell版本:


$ gnome-shell --version
GNOME Shell 3.26.2

选择适当的gnome Shell版本和扩展版本:

download gnome extension zip file

扩展程序的zip文件已下载到Downloads目录:


$ ls ~/Downloads/
This email address is being protected from spambots. You need JavaScript enabled to view it.



获取扩展UUID

以下linux命令将显示为包括metadata.json文件以检索扩展名的UUID:


$ unzip -c Downloads/This email address is being protected from spambots. You need JavaScript enabled to view it. metadata.json | grep uuid | cut -d \" -f4
This email address is being protected from spambots. You need JavaScript enabled to view it.

您的扩展程序的UUID是This email address is being protected from spambots. You need JavaScript enabled to view it.

创建目标目录

创建一个新目录,将先前下载的gnome扩展的内容解压缩到该目录中。确保使用您的Gnome扩展名的UUID更改目录名称:


$ mkdir -p ~/.local/share/gnome-shell/extensions/This email address is being protected from spambots. You need JavaScript enabled to view it.

解压缩Gnome扩展名

现在是时候将Gnome扩展解压缩到先前创建的目录中了:


$ unzip -q Downloads/This email address is being protected from spambots. You need JavaScript enabled to view it. -d ~/.local/share/gnome-shell/extensions/This email address is being protected from spambots. You need JavaScript enabled to view it./

启用Gnome扩展

接下来,启用新安装的扩展:


$ gnome-shell-extension-tool -e This email address is being protected from spambots. You need JavaScript enabled to view it.
This email address is being protected from spambots. You need JavaScript enabled to view it.' is now enabled.

剩下的就是重新启动gnome-shell。在撰写本文时,除了注销并重新登录外,我没有找到任何合理的非侵入式方式来重启Wayland上的gnome shell。如果您有一些提示,请在下面的注释部分中保留它们。

gnome shell extension wayland installed

参考资料

本文由Ubuntu问答整理, 博文地址: https://ubuntuqa.com/article/10634.html,未经允许,请勿转载。