Follow these steps to bind an auxiliary mouse button to a script on Ubuntu.
- Open a terminal and run the following command:
xev | grep button - Click the button inside the window. The terminal will output something like this:
Note the button number
state 0x10, button 8, same_screen YESbutton 8.
- Install the necessary packages by running the following command in the terminal
sudo apt-get install xbindkeys xautomation
- Create the default configuration file if it doesn't exist:
xbindkeys --defaults > ~/.xbindkeysrc - Open the configuration file for editing:
nano ~/.xbindkeysrc - Add a new binding at the end of the file, replacing
/path/to/your/script.shwith the path to your script, andb:8with the identified button number:"sh /path/to/your/script.sh" b:8
```
xbindkeys
```