Custom Shortcuts to Mouse Extra Buttons on Linux Mint

I have a Dragon War Leviathan Gaming Laser Mouse (ELE-G1) and I wanted to use the extra buttons, which currently defaults as forward and backward buttons respectively, to switch between 2 workspaces.

dragonwar

This would have been a lot easier on Windows, but I’m using Linux Mint 18, which unfortunately has only support to customize keyboard shortcuts, and not mouse.

But after a couple of minutes of Googling, here’s how I was able to make it work on Linux Mint 18:

First, you need to find your mouse buttons’ number using xev.

You will see something like the following:

Here, you can see the left mouse button as “button 1”. I didn’t include it in the sample results, but my mouse’s extra buttons were “button 8” and “button 9”.

Next, you need to install xbindkeys-config.

Then print a default rc file:

Next, open the xbindkeys-config window by simply:

And you will see something similar:

xbindkeys-config

Now, add a new entry. You can leave out the name but on the “Key” field, enter the mouse button number, for example: “b:8” for “button 8”. On the “Action” field, enter the command you wish to bind. But for me, I wanted this to be Workspace 0, the default one, and the command is “wmctrl -s 0”.

You can add another entry. Just be sure you click the “Apply” button to save it. In my case, I added another entry for my “button 9” to use to switch on Workspace 1, and the command for this is “wmctrl -s 1”.

That’s it! Now, I can switch between my 2 Workspaces with my mouse’s extra buttons!

 

Leave a Reply

Your email address will not be published. Required fields are marked *