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.
Needed packages
- xbindkeys
- xautomation
Install these tools eihter with (Fedora) dnf install xbindkeys xautomation
or (Debian)
apt-get install xbindkeys xautomation
Configurate xbindkeys
- To find out which keys on the mouse are the forward and backwards buttons. The programm xev does this job.. Execute
xev | grep button
and 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.
b:11
"xte 'keydown Alt_L' 'key Right' 'keyup Alt_L'"
b:10
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/.
[Desktop Entry]
Name=xbindkeys
GenericName=xbindkeys
Comment=Start xbindkeys at login
Exec=/usr/bin/xbindkeys
Terminal=False
Type=Application
X-GNOME-Autostart-enabled=true
. This will start xbindkeys non-daemonized with a verbose output. To start xbindkeys normally, execute xbindkeys
Links
A lot of information are gained through the following links
- https://wiki.ubuntuusers.de/xbindkeys
- https://ask.fedoraproject.org/en/question/59485/fedora-21-doesnt-come-with-gnome-session-properties/