11

Is there a way to install GNOME extensions from terminal, for example dash to dock? The way I do it now is to go into Ubuntu Software app store and install it.

pomsky
  • 70,557

3 Answers3

4

Dash to Dock GNOME extension

As seen at https://extensions.gnome.org/extension/307/dash-to-dock/

Download the .zip file here https://micheleg.github.io/dash-to-dock/releases.html

Note: the name of the downloaded .zip file may be different than the dash-to-dock@micxgx.gmail.com.zip shown in the unzip command shown below. Adjust the command as necessary for the correct .zip name.

See the manual installation notes here https://micheleg.github.io/dash-to-dock/download.html

Manual installation

You can also obtain the extension in the form of a zip archive from the release page. Look for the latest version supporting your shell version. The extension can be installed by means of gnome-tweak-tool, or alternatively by directly extracting the archive in the a directory named dash-to-dock@micxgx.gmail.com inside ~/.local/share/gnome-shell/extensions/

unzip dash-to-dock@micxgx.gmail.com.zip \ -d ~/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/

Shell reload is required Alt+F2 r Enter. The extension can be enabled with gnome-tweak-tool, or with dconf by adding dash-to-dock@micxgx.gmail.com to the /org/gnome/shell/enabled-extensions key.

Note: DtD is not compatible with 19.04.

  • rumor has it, that if you uninstall Ubuntu Dock, that DtD will work with 19.04

  • it also appears that the manual installation of DtD will make this work in 19.04

heynnema
  • 73,649
4

I just found two ways to install from the terminal. Personally, I prefer the python packaged tool for its simplicity, but the second way might give You more fine grained control over the installation process.

A) With a python package

# 1. Install the package
pip3 install gnome-extensions-cli

2. Install extension by UUID

gnome-extensions-cli install dash-to-dock@micxgx.gmail.com

2.a ... or by PK (primary key)

gnome-extensions-cli install 307

More information on the github page: https://github.com/essembeh/gnome-extensions-cli or use the gnome-extensions-cli --help.

If there is no active gnome shell session, the tool will complain. To fix, use --backend file.

B) With custom shell scripts

#!/usr/bin/env bash

uuid=dash-to-dock@micxgx.gmail.com pk=307

1. GNOME shell version

shell_version=$(gnome-shell --version | cut -d' ' -f3)

2. Fetch extension info (for the given shell version)

info_json=$(curl -sS "https://extensions.gnome.org/extension-info/?uuid=$uuid&shell_version=$shell_version")

2.a instead of ?uuid=$uuid you can use ?pk=$pk

3. Extract download url from the json with jq

download_url=$(echo $info_json | jq ".download_url" --raw-output)

4. Install the extension

gnome-extensions install "https://extensions.gnome.org$download_url"

4.a ... or download it first, then install

curl -sL "https://extensions.gnome.org$download_url" -o $uuid.zip gnome-extensions install $uuid.zip

4.a.i ... or manually extract the zip

mkdir -p ~/.local/share/gnome-shell/extensions/$uuid unzip $uuid.zip -d ~/.local/share/gnome-shell/extensions/$uuid

This is more or less the same as the python package does - apart from using the gnome-extensions utility that comes with the GNOME Shell.

JQ is a command line json processor - more on usage: https://stedolan.github.io/jq/

2

You can install Dash-to-Dock by running the following commmand:

sudo apt install gnome-shell-extension-dashtodock

You can get the list of available extensions by running apt search gnome-shell-extension for example.

pomsky
  • 70,557