How to setup extra buttons of mouse in Linux - AugustAtSeattle/How-To-Do-Step-By-Step- GitHub Wiki

I bought a Logitech mouse. It works well on windows and mac. But Its extra buttons can't work on linux. Following is tutorial to setup them.

Step 1 Install Software

sudo apt-get install xbindkeys xautomation x11-utils

Step 2 Look For extra buttons ID (in a opening white window).

xev | grep -A2 ButtonPress

Step 3 Create Config Files

xbindkeys --defaults > ~/.xbindkeysrc

Step 4 Edit Config Files and Example

gedit ~/.xbindkeysrc

"xte 'keydown Control_L' 'keydown Shift_L' 'key Tab' 'keyup Control_L' 'keyup Shift_L'"
b:6
#button 6 = control + shift + tab = move to right tab

"xte 'keydown Control_L'  'key Tab' 'keyup Control_L' "
b:7
#button 7 = control + tab = move to right tab

"xte 'keydown Control_L'  'key w' 'keyup Control_L' "
b:8
#button 8 = control + w = close tab

"`xte 'keydown Control_L'  'key c' 'keyup Control_L' ` && google-chrome 'www.google.com' && sleep 0.5 && `xte 'keydown Control_L'  'key v' 'keyup Control_L' 'key Return'`"
b:9
#button 9 = control + c + chrome + control + v + return = copy , open chrome ,paste and search

Step 5 Restart and Reload Config Files

xbindkeys -f ~/.xbindkeysrc

killall -s1 xbindkeys &

Ref: Some Useful keys

These keys are case sensitive.

Home
Left
Up
Right
Down
Page_Up
Page_Down
End
Return
BackSpace
Tab
Escape
Delete
Shift_L
Shift_R
Control_L
Control_R
Meta_L
Meta_R
Alt_L
Alt_R
Multi_key
Super_L
Super_R