↓ Twitter is updated more often, so read it! ↓

HOWTO Install btnx for better mouse control in Ubuntu Hardy

When I installed Hardy, I forgot to copy my awesome xorg.conf which held the configuration to enable all 12 buttons of my Logitech MX1000.

Lo and behold, a new method of configuring it has come about, albeit it was around prior to Gutsy.

btnx is the work of Olli Salonen. The program runs as a daemon, catching mouse events and turning them into either key presses or proper mouse events which the system can interpret. This eases the configuration one must do in order to enjoy the full potential of the high-end Logitech mice—a potential which, in my opinion, Windows cannot reach.

The installation process for btnx is pretty easy.

First, I replaced the mouse section of my /etc/X11/xorg.conf with this section. This may not be necessary, but I did it before discovering btnx.

Section "InputDevice"
        Identifier      "Logitech MX1000"
        Driver          "evdev"
        Option          "Name"          "Logitech USB RECEIVER"
        Option          "HWHEELRelativeAxisButtons" "7 6"
EndSection

Next, open a terminal and cd to the location where you keep your sources. I keep mine in ~/Source. This next section prepares the libraries required to build btnx and its support program, btnx-config, as well as subversion if you don’t already have it installed. I prefer to use subversion and checkout tags if they are available. It makes switching to a new version just a svn sw away. Last, it checks out the source for the two programs.

sudo apt-get install subversion libgtk2.0-dev libglade2-dev libdaemon-dev
svn co http://svn.ollisalonen.com/btnx/tags/btnx-0.4.9/
svn co http://svn.ollisalonen.com/btnx-config/tags/btnx-config-0.4.8/

Next, do a simple cm&smi for each program.

cd btnx-0.4.9
./configure && make && sudo make install
cd ../btnx-config-0.4.8
./configure && make && sudo make install

Now that both programs are installed, you must first configure btnx using btnx-config. Start it as root using the command below or go to Applications > System Tools > btnx. Click “Detect Mouse and Buttons”. You’ll probably be able to figure it out from there.

gksu btnx-config

I have the middle thumb button on my MX1000 configured to activate the Rotate Cube plugin of Compiz. I have it configured as Button10 in Compiz and BUTTON_9 in btnx. Remeber: Compiz and many other programs start counting buttons at 1, but btnx starts at 0.

Update: There is a post on Ubuntu Forums about building btnx, too.

Update 2008-04-29 01:18: I’ve posted an update. New versions of btnx and btnx-config are available and so are debs for both 32-bit and 64-bit Ubuntu.

Update 2008-11-05 20:56: As Christopher pointed out, Btnx is useless in Intrepid. Olli, the author of btnx, remarks that the way btnx interacted with the kernel is no longer available, so all development on btnx has ceased. However, he says, evdev is able to recognize all of the buttons on the Logitech MX Revolution. Folks who might be willing to decode the cryptic xevents system and figure out how to assign mouse events to other keypresses and such should contact him.

17 Comments

  1. Ghostlines:

    Thanks alot dude, this tutorial was great! Previously i just used the debs on Ollis Salonen’s site when i ran gutsy. But they didn’t work on hardy so i had to compile like you instructed.
    Keep up the good work !

  2. Scott Wegner:

    Good tutorial here. Advanced mouse configuration is another one of those features that needs to “just work” if Linux is going to really enter the mainstream desktop market. Hopefully there will be packages added to the Hardy repositories for btnx, so newer users don’t need to compile their own.

    –Scott

  3. Life Clerks » btnx Customizes a Multi-Button Mouse for Linux [Featured Linux Download]:

    [...] can be adapted to most any distribution. btnx is a free download for Linux systems only. HOWTO Install btnx for better mouse control in Ubuntu Hardy [The Flow of Consciousness via Ubuntu [...]

  4. Colin Dean:

    Scott: with a little luck and reference to the existing debs, I hope to get this added to Ubuntu by Intrepid (8.10). I want to get it into a PPA on Launchpad ASAP.

  5. The Flow of Consciousness » Blog Archive » Update on btnx HOWTO:

    [...] originally posted instructions on how to compile from source in the article HOWTO Install btnx for better mouse control in Ubuntu Hardy. Category: esperanto, howto  |  Tags: btnx, esperanto, gutsy, hardy, ubuntu [...]

  6. Colin Dean:

    Update, folks: Update on btnx HOWTO.

  7. The Flow of Consciousness » Blog Archive » HOWTO Add btnx repository to sources:

    [...] Olli Salonen made a PPA on Launchpad yesterday, following my request for btnx in a PPA. [...]

  8. power:

    it looks nice.

  9. Christopher:

    As of Intrepid Ibex 8.10, Btnx is completely defunct. You might want to post an update about that.

  10. Alanna:

    I recently came across your blog and have been reading along. I thought I would leave my first comment. I don’t know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.

    Alanna

    http://www.craigslistsimplified.info

  11. Story:

    Very useful files search engine. rapidshare-provider.com is a search engine designed to search files in various file sharing and uploading sites.

  12. Gary:

    Defunct or not, it works on Ubuntu 9.04

  13. Ivanovic:

    The btnx also works in Ubuntu 9.10. I have successfully tested it.
    To install, simply use “sudo apt-get install btnx”

    Then use “btnx-config” to detect and remap your mouse buttons. Restart btnx, and voila! your mouse comes to life :D

    I have used another brand of wireless mouse in the above procedure.

  14. freddyph:

    Also got this working with an MX revolution on 10.10 after tearing what’s left of my hair out with HIDpoint

  15. The Flow of Consciousness » Blog Archive » 2010 in review: the year of travel:

    [...] Blog-wise, I didn’t write a whole lot. I saw a year-over-year ~7.5% decrease in traffic. I attribute this to my lessened writing and bouncing from topic to topic. Also, my posts from summer 2009 regarding my stock purchases gave me a giant traffic burst I did not replicate this past year. My 2007 article on installing Roundcube Webmail on Ubuntu Feisty continued to be the #1 article on my blog (as it has been since its writing), followed by my 2008 article on using btnx for mouse control in Ubuntu Hardy. [...]

  16. btnx Customises a Multi-Button Mouse for Linux | Lifehacker Australia:

    [...] can be adapted to most any distribution. btnx is a free download for Linux systems only. HOWTO Install btnx for better mouse control in Ubuntu Hardy [The Flow of Consciousness via Ubuntu [...]

  17. http://www.sportskacentrala.com/phpinfo.php?a=a+hrefhttpwww.nur-hier.eutoplisteindex.phpastatsumarvinrsyhffwowww.nur-hier.eua:

    http://www.sportskacentrala.com/phpinfo.php?a%5B%5D=%3Ca+href%3Dhttp%3A%2F%2Fwww.nur-hier.eu%2Ftopliste%2Findex.php%3Fa%3Dstats%26u%3Dmarvinrsyhffwo%3Ewww.nur-hier.eu%3C%2Fa%3E

    The Flow of Consciousness » Blog Archive » HOWTO Install btnx for better mouse control in Ubuntu Hardy…