I had the idea recently to bind the two unused buttons on the side of my mouse so that clicking them moved my desktop workspaces up and down. I already do this using keyboard shortcuts of course, using Ctrl+Super+Up
and Ctrl+Super+Down
in my case, but I thought it might be handy to have this on the mouse too.
That should be easy to do, right? Well it is when you know how.
I fiddled around with xbindkeys
for an age but couldn't get it to do what I wanted. In the end, I found easystroke
which, despite a challenging UI, did the job nicely.
The instructions below are tested on a standard Pop!_OS install, but note that I couldn't get this to work when using the Wayland windowing system. I don't know why.
Here's how I did it:
First, install it using sudo apt install easystroke
or whatever your equivalent function is.
Open up the software and then:
Preferences
tabAdditional buttons
thingyAdd
buttonActions
tabAdd Action
buttonCommand
to Key
. You may get a warning here about Easystoke wanting to "inhibit shortcuts". If so, click Allow
.Key combination...
and type the keyboard shortcut combination you want to be triggeredRecord Stroke
button, then press the mouse button you want to trigger the actionThis process isn't the most intuitive, so here's a screenshot showing the end outcome I wanted:
At this point, you should be able to use your mouse buttons to trigger the actions you've just defined.
Easystroke shows a little indicator on screen of the action you've just performed. If, like me, you find this a little annoying, you can disable it by deselecting the Show popups
checkbox on the Preferences
tab.
Finally, you probably want these actions available automatically each time you boot up your machine. To do that, go to the Preferences
tab again, and enable the Autostart easystroke
checkbox.
Et voilà!