This short tutorial shows how to make every button of the Logitech Performance Mouse MX work on Linux. I have only tested it on Ubuntu Linux (12.04, 12.10, 13.04, 13.10, 14.04, 14.10 and 15.04 Desktop) so far, but it should work as well on all other modern Linux distributions. Basically the mouse works just fine out of the box but there are some things that need a little bit of tuning to make all the features work as expected (e.g. as on Windows).
Update 2015-07-30: Apparently some users want to get the zoom button + wheel to zoom, not just toggling the control. Camilo Rada kindly shared his solution for that.
sudo apt-get install compizconfig-settings-managerThen open the CompizConfig settings manager (ccsm) and click on the "Scale" plugin: Then go to the Bindings tab and select Initiate Window Picker For All Windows with the mouse symbol in front of it and assign the function to Button 10 (which is the thumb button): With this setting the button needs to be pressed to show you all opened windows. When you release the button it will be automatically switched to the window that lies under the cursor. If you like that behaviour you can of course leave it like that. However on Windows the button just toggles the function so that the button doesn't need to be pressed all the time. To get that very same behaviour just check the radio button which says Button Bindings Toggle Scale Mode (cp. screenshot).
sudo apt-get install xbindkeys xautomationThen create the file .xbindkeysrc with the following content in your home folder:
"/usr/bin/xte 'keydown Control_L' &" b:13 "/usr/bin/xte 'keyup Control_L' &" Control + b:13The configuration can be tested with:
xbindkeys -n -vXbindkeys has to be started after every login to work permanently. On Ubuntu you can add a Startup Application in the menu on the upper right to do that. With xbindkeys you can also do all kinds other customizations. Feel free to experiment with it!
Apparently some users want to get the zoom button + wheel to zoom, not just toggling the control. Camilo Rada kindly mailed me his configuration file for xbindkeys that allows to zoom with the wheel when the zoom button is pressed and also allows to assign a command to the press-and-release action of the zoom button.
The configuration file has to be placed in your home folder with the name .xbindkeysrc.scm and the following content:
;; This configuration is guile based. ;; http://www.gnu.org/software/guile/guile.html ;; This config script is supposed to live in the homedirectory and be named .xbindkeysrc.scm ;; Based on the script by Zero Angel posted at ;; http://www.linuxquestions.org/questions/linux-desktop-74/%5Bxbindkeys%5D-advanced-mouse-binds-4175428297/ ;; And adapted by Camilo Rada ;; ;; It is intended to work with the Logitech Performance MX Mouse ;; It allows to zoom with the wheel while the zoom button is pressed ;; It also allows to assing an action to a single press-and-release of the zoom button ;; The action assigned to that action is Super+z but is can be modified (define actionperformed 0) (define (first-binding) "First binding" ;; Logitech Zoom Button (xbindkey-function '("b:13") b13-second-binding) ) (define (reset-first-binding) "reset first binding" (ungrab-all-keys) (remove-all-keys) ;; Set Action Performed state back to 0 (set! actionperformed 0) ;; Forcefully release all modifier keys! (run-command "/usr/bin/xte 'keyup Control_L' 'keyup Alt_L' 'keyup Shift_L' 'keyup Super_L' &") (first-binding) (grab-all-keys)) (define (b13-second-binding) "Zoom Button Extra Functions" (ungrab-all-keys) (remove-all-keys) ;; Scroll Up (xbindkey-function '("b:4") (lambda () ;; Emulate Ctrl+plus (Zoom in) (run-command "/usr/bin/xte 'keydown Control_L' 'key plus' 'keyup Control_L' &") (set! actionperformed 1) )) ;; Scroll Down (xbindkey-function '("b:5") (lambda () ;; Emulate Ctrl+Alt+minus (Workspace Down) (run-command "/usr/bin/xte 'keydown Control_L' 'key minus' 'keyup Control_L' &") (set! actionperformed 1) )) (xbindkey-function '(release "b:13") (lambda () ;; Perform Action if Button 8 is pressed and released by itself (if (= actionperformed 0) (run-command "/usr/bin/xte 'keydown Super_L' 'key z' 'keyup Super_L' &")) (reset-first-binding))) (grab-all-keys)) ;; (debug) (first-binding) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; End of xbindkeys configuration ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
The programs xbindkeys and xautomation both have to be installed as described in Toggling zoom. Special thanks go to Camilo Rada for sharing his solution.