Gnome Panel – Set Order of Extensions and Indicators in Gnome 3

gnomepanel

Is it possible to set the order in which extensions/indicators appear in the top panel in gnome 3 as they seem to change position every time I login and I want to set a specific order.

Best Answer

TL;DR The way is a little bit tricky:

You can reload and so influence the order the extensions.

Use this command and replace <Extension_UUID> with the UUID of the extension, don't use the ID:

gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method <Extension_UUID>

But I have found that sometimes the extension must be reloaded twice to achieve an effect.


Example:

My system wide extensions:

% ls -og  /usr/share/gnome-shell/extensions
total 4
drwxr-xr-x 2 4096 Mär 31 15:15 GPaste@gnome-shell-extensions.gnome.org

My per user extensions:

% ls -og ~/.local/share/gnome-shell/extensions/
total 16
drwxrwxr-x 3 4096 Mär 26 08:01 drive-menu@gnome-shell-extensions.gcampax.github.com
drwxrwxr-x 3 4096 Mär 26 08:02 laine@knasher.gmail.com
drwxrwxr-x 4 4096 Mär 26 07:56 user-theme@gnome-shell-extensions.gcampax.github.com
drwxrwxr-x 3 4096 Mär 26 07:57 web_search_dialog@awamper.gmail.com

The extension ID should be the folder name, eg. drive-menu@gnome-shell-extensions.gcampax.github.com.

To be sure, I would pick up the UUID from the metadata file:

% less ~/.local/share/gnome-shell/extensions/drive-menu@gnome-shell-extensions.gcampax.github.com/metadata.json
{
  "_generated": "Generated by SweetTooth, do not edit", 
  "description": "A status menu for accessing and unmounting removable devices.", 
  "extension-id": "drive-menu", 
  "gettext-domain": "gnome-shell-extensions", 
  "name": "Removable Drive Menu", 
  "settings-schema": "org.gnome.shell.extensions.drive-menu", 
  "shell-version": [
    "3.16"
  ], 
  "url": "http://git.gnome.org/gnome-shell-extensions", 
  "uuid": "drive-menu@gnome-shell-extensions.gcampax.github.com", 
  "version": 28
}

Therefore this is the command to reload the extension

gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Extensions.ReloadExtension "drive-menu@gnome-shell-extensions.gcampax.github.com"

The UUID can be determined reliably with the following commands:

Install a JSON parser:

sudo apt-get install jq

Determine the UUID with:

jq '.uuid' ~/.local/share/gnome-shell/extensions/<shell_extension_path>/metadata.json

Example:

% jq '.uuid' ~/.local/share/gnome-shell/extensions/drive-menu@gnome-shell-extensions.gcampax.github.com/metadata.json
"drive-menu@gnome-shell-extensions.gcampax.github.com"

Or all in one:

gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Extensions.ReloadExtension  $(jq '.uuid' ~/.local/share/gnome-shell/extensions/drive-menu@gnome-shell-extensions.gcampax.github.com/metadata.json)

An other great solution is this answer.