2

The standard shortcut to switch workspaces are Ctrl+Alt+Pgdown or Ctrl+Alt+Pgup and I want to bind these commands to buttons in my mouse. Therefore, I can achieve what I want using xbindkeys and xdotool by placing in the .xbindkeysrc the following:

"xdotool key 'Control_L+Alt_L+Up'"
   b:9

"xdotool key 'Control_L+Alt_L+Down'"
   b:8

The problem is that this setup is quite unresponsive and frequently slow.

So I wonder if there are direct commands to avoid using xdotool. Iḿ using Ubuntu 20.04. Any help would be appreciated!

3
  • I just read through this link, it seems to do what you need and it's systematic and includes screenshots. It requires x11 which you should have on 20.04. linuxuprising.com/2019/11/…
    – user1383491
    Nov 17, 2021 at 2:14
  • @TBr note that this is exactly the approach OP is currently using. The question is if there is an alternative because this approach is quite unresponsive. Anyway, indeed this approach only works on Xorg whereas Wayland is increasingly replacing Xorg.
    – vanadium
    Nov 17, 2021 at 7:49
  • @vanadium I see, I missed that thank you.
    – user1383491
    Nov 17, 2021 at 15:59

1 Answer 1

1

A way to do this using commands is indicated by Florian Muellner himself in this post. The command you need is

dbus-send --session --type=method_call --dest=org.gnome.Shell /org/gnome/Shell org.gnome.Shell.Eval string:'global.workspace_manager.get_active_workspace().get_neighbor(Meta.MotionDirection.DOWN).activate(global.get_current_time());'

Change .DOWN to .UP to move upwards. If you are on Gnome 40 or up (Ubuntu 21.10 and up), then use .LEFT or .RIGHT.

2
  • Thanks! That is precisely what I was looking for!
    – fmakoto
    Nov 17, 2021 at 13:18
  • And in fact, the buttons get completely responsive using this approach. Regards!
    – fmakoto
    Nov 17, 2021 at 13:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .