I bought a new Logitech mouse, the M560 wireless. What I wanted was that two keys of my mouse are ”History Forward” and ”History backward” action in my browser. Unfortunately, Logitech Inc. does not provide a sufficient linxu driver. Therefore, I had to customize the ouse on my onw, which tooks a bit of research.
Install these tools eihter with (Fedora)
dnf install xbindkeys xautomation or (Debian)
apt-get install xbindkeys xautomation
- To find out which keys on the mouse are the forward and backwards buttons. The programm xev does this job.. Execute
xev | grep buttonand click in the opened window. The number after the word button is the button number.
- Configure the xbindkeys configuration. To do so, execute
xbindkeys --defaults ~/.xbindkeysrc
- Open the file .xbindkeysrc. The History forward and backward action can be achieved with the keyboard combination Alt + Right and Alt + Left. So a click on the mouse button (in my case number 10 and 11) should send this signal. Thats were the programm xte comes into play. In the opened file, the following lines have to be added:
"xte 'keydown Alt_L' 'key Left' 'keyup Alt_L'"The first two lines associate the button nr 11 to the history back action. The second line thas the sam ewith the history forward action.
"xte 'keydown Alt_L' 'key Right' 'keyup Alt_L'"
Save the file.
- To test the configuration, execute
xbindkeys -n -v
- Set xbindkeys to the autostart. One possibility is to add a desktop-file in ~/.config/autostart/.
Comment=Start xbindkeys at login
. This will start xbindkeys non-daemonized with a verbose output. To start xbindkeys normally, execute
A lot of information are gained through the following links