How to launch extension from terminal?

Is there a standardized command from launching (not enabling) extension from cli?

For example, I like, but it launches with keybinding Super+w. I also like which gives the option to activate program with preset command.

What is the command, in cli, for activating wsmatrix extension?

Is it so specific to certain extension so there is no uniformed way to do that? Should I make a feature request to gnome-extensions developer(s)?

for example, to enable it, we run:

gnome-extensions enable nameOf@extension

Is there a way to implement launch/start like:

gnome-extensions start nameOf@extension

I’m not sure what you mean by activate, but there is no such thing as “launching” an extension.

Extensions are patches that are applied when the enable() function is called, and reverted when the disable() function is called. Those functions correspond the the gnome-extensions enable and gnome-extension disable, respectively.

There is no other entry point for extensions, so there’s no way for the CLI to do anything but that. Can you describe what you expect to happen when an extension is “activated”?

Thank You for replying.

So, the extension Workspace Matrix (Workspace Matrix - GNOME Shell Extensions) can be launched/activated/started (I’m not sure about terminology) with Super+w keyboard shortcut. I only want to know what command/SysReq triggers that shortcut.

I understand what is enabling, but don’t know how to activate (or launch/start) it from cli. I need that command so I can assign it to one of hot corners defined in Custom Hot Corners - Extended (Custom Hot Corners - Extended - GNOME Shell Extensions).

First I taught I only need to start javascript file with:

node extension.js

But obviously that’s not what I’m looking for.

You can not execute JavaScript functions of an extension with a CLI tool, since they are internal to the extension. If the author has not modified the default overview, you may be able to open it with gdbus, but I make no guarantees:

gdbus call -e -d org.gnome.Shell -o /org/gnome/Shell -m org.freedesktop.DBus.Properties.Set "('org.gnome.Shell', 'OverviewActive', <true>)"

Unfortunately, that won’t work at all. Extensions will only work from inside the GNOME Shell process, and they are executed by GJS not node.js. So you can’t run an extension like a normal script, and certainly not with node.

Yes, it won’t work. It throws:

Error: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.DBus.Properties” on object at path /org/gnome/Shell

Ok, I give up. Thank You for explanation (now I will read more on GJS and GNOME :slight_smile: ).

xdotool key super+w

will do the job!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.