Fight for the Internet 1!

Friday, December 28, 2012

Compiling btnx for Ubuntu 12.04 and 12.10 and beyond (and Fedora too)

This is a quick and dirty guide how to compile btnx for yourself to get it to work on your Ubuntu or Kubuntu or Fedora systems.

You will need to compile both the program btnx and the program btnx-config.

This guide isn't necessarily for beginners but I will try to keep it simple.

UPDATE: I have found someone who is taking stewardship of the btnx project. He has moved the code from the derelict bazaar repos on Launchpad (one of which has permanently disappeared) and created a github repository for the project(s). He has also mainlined my patches and is tracking down other bugfixes on forks. I tested his code on Fedora 18, 19, Ubuntu 12.04, 13.04 and 13.10. All worked.

https://github.com/cdobrich/btnx
https://github.com/cdobrich/btnx-config

The instructions have been simplfied accordingly.

Compiling on Ubuntu

The compilation process for Ubuntu is almost exactly the same as for Fedora.

(0) In general, you will need to be able to compile programs on your Ubuntu machine. You should have the package "build-essential" installed already.

(1) Grab the program source files.

For the btnx-config page, you want to download
https://github.com/cdobrich/btnx-config

For the btnx page, you want to download
https://github.com/cdobrich/btnx

(2) Open up your favorite terminal. To install the btnx dependencies, do the following:
sudo apt-get install libdaemon-dev libgtk2.0-dev libglade2-dev
(3)  Navigate there and run './configure' (without quotes), and then 'make' (without quotes) and finally 'make install' (without quotes).

(4) Now both programs of btnx and btnx-config are installed on your system.

Compiling on Fedora

The compilation process for Fedora is almost exactly the same as for Ubuntu.

(0) In general, you will need to be able to compile programs on your Ubuntu machine. You should have the packages to compile and build programs installed already. To this in Fedora, run the following command:
sudo yum groupinstall "Development Tools" "Development Libraries"
This might be a bit overkill since it installs a lot, and you can remove this group when you are done.

(1) Grab the program source files.

For the btnx-config page, you want to download
https://github.com/cdobrich/btnx-config
For the btnx page, you want to download
https://github.com/cdobrich/btnx
(2) Open up your favorite terminal. To install the btnx dependencies, do the following:
sudo yum install libdaemon-devel gtk2-devel libglade2-devel
(3)  Navigate there and run './configure' (without quotes), and then 'make' (without quotes) and finally 'make install' (without quotes).

(4) Now both programs of btnx and btnx-config are installed on your system.


Errors

Error message:
failed to execute command /etc/init.d/btnx restart
Cause: You probably don't have the little dongle for the USB mouse plugged in. At least I always get this error if I try to use the btnx-config program and don't have my mouse plugged in yet.

Warning

It may appear in your applications-menus, but I have noticed a problem with using inside KDE. It asks for the ROOT password, not my user password with elevated privileges. I'm not sure how to fix this, but I'd love to find out. It's not a big deal for me though.

Hope that helps anyone.

10 comments:

  1. Got btnx working on 12.10.
    Thank you.

    ReplyDelete
  2. I just used the .deb packages from the universe repository on the ubuntu site.
    Just double click the .deb files and the software installer starts.
    First the btnx than the btnx-config. Otherwise it won't work.


    BTNX
    For AMD64

    http://packages.ubuntu.com/oneiric/amd64/btnx/download
    For I368
    http://packages.ubuntu.com/oneiric/i386/btnx/download



    BTNX CONFIG
    For AMD64
    http://packages.ubuntu.com/lucid/amd64/btnx-config/download
    For I386
    http://packages.ubuntu.com/lucid/i386/btnx-config/download

    ReplyDelete
  3. I tried downloading the .deb packages as above with 12.10 but btnx immediately crashed after installing.

    ReplyDelete
  4. Compiling failed at a friends Ubuntu 12.10 today. Could you provide binaries or re-check your howto on a recent (up-to-date) installation?

    ReplyDelete
    Replies
    1. What stage is the compilation failing at? Can you use pastebin.com or something to paste the console error outputs?

      Delete
  5. Thank you! I am saved! I cannot even begin fathoming why would ubuntu discontinue such a useful program!?

    ReplyDelete
    Replies
    1. I think the package maintainer person for Ubuntu stopped supporting it. (Community volunteer.) His reasons might have been because the original developer of BTNX no longer supported the application.

      Either way, I actually think this application should be made a priority by many desktops, since mice with multiple buttons are important and more common now. They are especially important for people with disabilities that need the extra functionality.

      Delete
  6. agree!!! configuring a multi button mouse in linux shouldnt be exhausting! NO ONE wants don't want to go thru xbindkeys, xev, imwheel, xvkbd, xte nonsence just to get mouse to work:)

    ReplyDelete
  7. Thanks! I used your instructions to write this setup script for myself. I use this when I setup a new Ubuntu install. Hope it helps.

    #!/bin/bash

    # formatted printing function
    say () { echo "___$1___"; return 0; }

    say "Installing btnx dependencies"
    sudo apt install build-essential libdaemon-dev libgtk2.0-dev libglade2-dev -y

    mkdir -p ~/bin/tmp
    cd ~/bin/tmp

    say "Downloading and extracting btnx source"
    wget https://github.com/cdobrich/btnx-config/archive/master.zip -O btnx-config.zip
    wget https://github.com/cdobrich/btnx/archive/master.zip -O btnx.zip

    unzip btnx-config.zip
    unzip btnx.zip

    say "Building btnx"
    cd btnx-master/
    ./configure
    make
    sudo make install

    say "Building btnx-config"
    cd ../btnx-config-master/
    ./configure
    make
    sudo make install

    say "Btnx is now installed"

    ReplyDelete
    Replies
    1. Jeremy, awesome! still using btnx in 2016! :)

      Delete