11

I'm looking for a way to reliably install gnome-shell extensions on the command line. At the end of the day, I'd like to have an Ansible playbook.

As an example, I'd like to install custom-hot-corners-extended.

I found "Install GNOME extension using command line" on medium.com and also "How to install Gnome Extensions on Ubuntu 20.04" on linuxhint.com. Following these, I did:

wget -O/tmp/extension.zip https://extensions.gnome.org/extension-data/custom-hot-corners-extendedG-dH.github.com.v11.shell-extension.zip
uuid=$(unzip -c /tmp/extension.zip metadata.json | grep uuid | cut -d \" -f4)
unzip /tmp/extension.zip -d "~/.local/share/gnome-shell/extensions/$uuid"
gnome-shell-extension-tool -e "$uuid"
# or:
gnome-extensions enable "$uuid"

But it doesn't work - I get an error: Extension »custom-hot-corners-extended@G-dH.github.com« does not exist

It's (of course) also not shown in gnome-extensions-app. Manually installing the from the GNOME Extensions site in the browser works just fine.

Also tried using the gnome-shell-extension-installer script from brunelli - also no go… :/

I'm using GNOME Shell 40.5 on Ubuntu 21.10 Impish.

alexs77
  • 460

2 Answers2

4

I've recently come across gnome-extensions-cli, which seems to have been around for some time, but has only recently gained new activity (see Code frequency of the project). I think it's a great tool, it produces beautiful output, and it's also script-friendly. The CLI lets you search, install, upgrade, enable and list GNOME extensions, among other things.

If you don't mind installing a Python dependency on your target machine, you could write a couple of Ansible tasks to achieve your goal, like so:

- name: Install CLI tool to manage GNOME extensions
  ansible.builtin.pip:
    name: gnome-extensions-cli
    extra_args: --user --upgrade
  • name: Install and enable GNOME extensions ansible.builtin.command: cmd: gext install "gTile@vibou" gext enable "gTile@vibou"

3

You can install from a .zip file with:

gnome-extensions install ./custom-hot-corners-extendedG-dH.github.com.v11.shell-extension.zip

It may not work immediately after installation (nor will the addon appear in the list of installed extensions of the extension app), which is clearly a bug someone needs to report. However, once you log out and log in back, it will start working.

The gnome-shell-extension-tool is obsoleted in preference of gnome-extensions utility.

Hi-Angel
  • 584