blipk / Customised-Workspaces

Customised Isolated Workspaces - Gnome-Shell Extension
Other
68 stars 6 forks source link

Is there a way to trigger mounting/dismounting desktops with a command from terminal? #11

Closed georgesoteriou closed 3 years ago

georgesoteriou commented 3 years ago

I want to add keyboard shortcuts to mount a specific desktop. A CLI would make this easy to do.

blipk commented 3 years ago

There is no CLI support and it is not planned. I would welcome a PR it shouldn't be too difficult but I don't have the time right now. If you would like me to guide you on how to implement it let me know.

blipk commented 3 years ago

Hi @georgesoteriou

I found a solution that may work for you, you can use dbus calls to call any function in the extension code e.g.: dbus-send --session --type=method_call --dest=org.gnome.Shell /org/gnome/Shell org.gnome.Shell.Eval string:'Main.extensionManager.lookup("worksets@blipk.xyz").workspaceManager.switchToWorkspace(1);'

For your use: dbus-send --session --type=method_call --dest=org.gnome.Shell /org/gnome/Shell org.gnome.Shell.Eval string:'let x = Main.extensionManager.lookup("worksets@blipk.xyz"); x.session.displayWorkset(x.session.Worksets[1]);'