Results 1 to 10 of 185

Thread: HOWTO Configuring Logitech mice in Ubuntu 6.06 32 bit, based on endy's HOWTO

Threaded View

  1. #1
    Join Date
    Oct 2005
    Location
    California
    Beans
    572
    Distro
    Kubuntu 9.04 Jaunty Jackalope

    HOWTO Configuring Logitech mice in Ubuntu 6.06 32 bit, based on endy's HOWTO

    Please go to the new guide. Use this guide only if the new one fails no matter what you try.

    A complete guide to a Logitech mouse
    WARNING: Contains hacks, not for the faint of heart.

    This is endy's guide on how to get all the buttons working properly on a logitech mouse (modified by me for Ubuntu 6.06), how to use the "logitech_applet" to enable the higher resolutions and cruise control and how to get the side mouse buttons to make forwards and back work in Nautilus, Epiphany, Konqueror, etc.

    This works for my mx500, I assume it would work for the similar mx510 and mx518 and the wireless versions like the mx700 however, I haven't got all those mice so I'd appreciate it if anyone get them working to post a reply and I'll make a list of what works.


    Section 1: Getting your mouse working on USB with evdev

    First off you need to plug your mouse into a USB port, you can't do anything else in this how to until you do that.

    0.9 You need an older version of evdev, the current one is broken.

    In your terminal, type:

    Code:
    wget http://detyabozhye.com/other/xserver-xorg-input-evdev_1.0.0.5-0ubuntu2_i386.deb
    Code:
    sudo dpkg -i xserver-xorg-input-evdev_1.0.0.5-0ubuntu2_i386.deb
    To avoid it updating to the new version (broken), open Synaptic Package Manager. Find xserver-xorg-input-evdev, select it, go to Package->Lock Version. Close Synaptic. The tradeoff here is that if a working new version comes out, you won't know about it.

    1. Getting all the information you need

    Great, so we're all plugged in via USB and ready to go. Before we change anything we need to get some important information about the mouse so run the following command in your favourite terminal:

    Code:
    cat /proc/bus/input/devices
    You should get a list of details, here's what I get and I'll highlight the bit we need to concentrate on:

    Code:
    I: Bus=0010 Vendor=001f Product=0001 Version=0100
    N: Name="PC Speaker"
    P: Phys=isa0061/input0
    S: Sysfs=/class/input/input0
    H: Handlers=kbd event0
    B: EV=40001
    B: SND=6
    
    I: Bus=0003 Vendor=046d Product=c025 Version=1800
    N: Name="Logitech USB-PS/2 Optical Mouse"
    P: Phys=usb-0000:00:1d.1-1/input0
    S: Sysfs=/class/input/input1
    H: Handlers=mouse0 event1 ts0
    B: EV=7
    B: KEY=ff0000 0 0 0 0 0 0 0 0
    B: REL=103
    
    I: Bus=0003 Vendor=049f Product=000e Version=0100
    N: Name="Compaq Compaq Internet Keyboard"
    P: Phys=usb-0000:00:1d.1-2/input0
    S: Sysfs=/class/input/input2
    H: Handlers=kbd event2
    B: EV=120003
    B: KEY=10000 7 ff87207a c14057ff febeffdf ffefffff ffffffff fffffffe
    B: LED=7fff
    
    I: Bus=0003 Vendor=049f Product=000e Version=0100
    N: Name="Compaq Compaq Internet Keyboard"
    P: Phys=usb-0000:00:1d.1-2/input1
    S: Sysfs=/class/input/input3
    H: Handlers=kbd event3
    B: EV=3
    B: KEY=20000 87a 5000d000 1e0000 0 0 0
    Note: For mx700 users the mouse name is "Logitech USB Receiver"

    1.1 Adding a udev rule

    I've found that the event number for the mouse sometimes changes in 6.06, so we'll make a udev rule.

    Type this in your terminal:
    Code:
    sudo gedit /etc/udev/rules.d/19-local.rules
    and paste this into there and save it (replace the bold part with the name of your mouse and replace the underlined part with whatever you want to put there, it will be used in xorg.conf):

    Code:
    KERNEL=="event[0-9]*", SYSFS{../name}=="Logitech USB-PS/2 Optical Mouse", NAME="input/mx500"
    2. Editing the xorg.conf file

    Now we have the information we need to start to set up xorg. So open up your xorg.conf file in your favourite editor, mine is mousepad but as gedit is on everyone elses install by default you can type:
    Code:
    sudo gedit /etc/X11/xorg.conf
    Now scroll down to the mouse section and instead of deleting it we're going to comment it out, to do this you put a "#" in front of each line in the section, again here is my commented section as an example:

    Code:
    #Section "InputDevice"
    #    Identifier     "Configured Mouse"
    #    Driver         "mouse"
    #    Option         "CorePointer"
    #    Option         "Device" "/dev/input/mice"
    #    Option         "Buttons" "10"
    #    Option         "ButtonMapping"         "1 2 3 6 7"
    #    Option         "Protocol" "ExplorerPS/2"
    #    Option         "ZAxisMapping" "4 5"
    #    Option         "Resolution" "800"
    #EndSection
    Again, yours might look different, the important bit is to comment the whole section out, but only this section.

    Next up we want to paste in out new section, make a but of room underneath (or above if you prefer) that section we just commented out and paste in the following template:

    Code:
    Section "InputDevice"
    	Identifier	"Configured Mouse"
    	Driver		"evdev"
    	Option		"CorePointer"
    	Option		"Device"	"/dev/input/mx500" #this should be that underlined name from 19-local.rules
    EndSection
    Make sure you save the changes to your xorg file.

    3. Restart X

    Warning!
    Don't restart X yet! Just before we do I have to warn you if you made a mistake in the xorg file X will not restart. But don't worry that's why we only commented out the previous settings and didn't delete them. If X fails to restart then you will end up in a text console. Log in and type the following to edit the xorg file:

    Code:
    sudo nano /etc/X11/xorg.conf
    All you need to do is comment out the new section we just added by putting a "#" in front of each line and un-commenting the original section by deleting the "#" which is at the start of each line. Save the xorg file in nano by typing "CTRL + X" press "Y" to confirm the save and type "startx" to get back to your desktop and re-read section two carefully and correct your xorg file.


    Ok, I'm ready
    Now we're prepared, restart X by first logging out then pressing "CTRL + ALT + BACKSPACE" simultaneously and hopefully after a moment you can log back in.


    4. Editing the Xmodmap file The higher models, such as the MX1000, don't need this part. Thanks to adam.tropics for the heads up.

    Code:
    gedit ~/.Xmodmap
    and paste the following, overwriting any previous "pointer" line:
    Code:
    pointer = 1 3 2 4 5 8 9 6 7 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
    Now run xmodmap to apply these settings:
    Code:
    xmodmap ~/.Xmodmap
    If this is the first time you created a .Xmodmap file then next time you log into gnome it will ask you if you want to automatically load it, add the file and click Ok if this happens.

    Now all the buttons should work properly including the little up button above the scroll wheel. The side buttons should also make Firefox go forward and backward a page just like before but they will not work in Nautilus or Konqueror yet. Keep reading to see how to get that to work!

    Note: If you're mouse has more or less buttons then you'll need to figure out what button numbers are the two side buttons, you can do this with the utility "xev" which you run from the terminal, hover the mouse over the pop up box and hold it still and press the side buttons. You'll see some output part of which is a button number. The two button numbers for you mouse go last in the .Xmodmap file, look at mine as an example.
    Section 2: Side buttons and Nautilus, Epiphany, Konqueror, etc

    We can use "xvkbd" and "xbindkeys" to bind the side mouse buttons to "ALT + LEFT" and "ALT + RIGHT" so they work as forward and backwards in Nautilus.


    1. xvkbd and xbindkeys

    Lets install "xvkbd" and "xbindkeys":

    Code:
    sudo apt-get install xvkbd xbindkeys
    Next we need to create the configuration for them:

    Code:
    gedit ~/.xbindkeysrc
    Now paste the following (Note: With some updates in the Dapper flights, the bath to xvkbd changed, please update your .xbindkeysrc accordingly):

    Code:
    "/usr/bin/xvkbd -xsendevent -text "\[Alt_L]\[Left]""
      m:0x0 + b:6
    "/usr/bin/xvkbd -xsendevent -text "\[Alt_L]\[Right]""
      m:0x0 + b:7
    Please note, the "L" and "R" from the words "left" and "right" in the square brackets above should be capitalised, this seems like a bug in the forums here that they don't display properly.

    Make sure you keep the quote marks, save the file and run "xbindkeys" in the terminal. It runs as a daemon in the background. You should now be able to test if it works in Nautilus by using the side buttons it also works in Epiphany if you use it.

    Note: Same as before, if you have different mouse buttons use xev to find out what number they are and change the "b:6" and "b:7" in the above to the correct numbers.

    1.1 Fixing the cruise control buttons

    Note: Requires the package build-essential

    Install these three packages for "click" to compile:
    Code:
    libx11-dev
    x11proto-xext-dev
    libxtst-dev
    Download this file: http://bg.rifetech.com/click.tgz
    untar it to ~/click (or wherever you want, just remember the dir, you'll need it in the .xbindkeysrc)
    then compile it:

    Code:
    cd ~/click
    make
    Then add this to you .xbindkeysrc

    Code:
    "~/click/click 4"
      m:0x0 + b:11
    "~/click/click 5"
      m:0x0 + b:12
    2. Adding it to your session

    Now it's working open up the gnome sessions settings "System > Preferences > Sessions" click on the "Startup Programs" tab, click "Add" and enter "xbindkeys". This makes sure it's run each time you log in, you should probably test it by logging out and back in now. If you aren't running GNOME, you will need to do it another way, e.g. in XFCE, go to Xfce Menu -> Settings -> Autostarted Applications. (I haven't tried it, but that should be where to go in XFCE)
    Section 3: The logitech_applet


    First of all some people use a program called LMCtl instead. This section is for making sure your mouse is using the best resolution it can, making it more accurate which is pretty handy especially in games where that counts like Quake 3


    1. Getting everything we need

    There is no logitech_applet in Synaptic so I just download the source and use the program "checkinstall" to package it and install it, you'll also need the "build-essential" packages which can be quite large so bear this in mind and the "libusb-dev" library. Once this is done you can uninstall it if you want via Synaptic. Ok so lets download and install logitech_applet:

    Code:
    sudo apt-get install checkinstall build-essential libusb-dev
    wget http://detyabozhye.com/other/logitech_applet-0.4test1.tar.gz
    tar xvfz logitech_applet-0.4test1.tar.gz
    mv ./logitech_applet-0.4test1 ./logitech-applet-0.4test1
    cd ./logitech-applet-0.4test1
    ./configure --prefix=/usr
    make
    sudo checkinstall
    Just hit enter when checkinstall prompts you. Now it should be installed


    2. Working logitech_applet

    I use the command "logitech_applet -s 800 -e" which you can run now:

    Code:
    sudo logitech_applet -s 800 -e
    This sets the mouse resolution to it's maximum 800cpi and makes sure the "cruise control" is enabled, you'll probably have to adjust the mouse settings in gnome as it should be much more accurate now. Type "logitech_applet --help" for more information.


    3. Load on boot

    We need to add this to a start up script so it's done automatically when the machine boots up, to do this I make a file in /etc/init.d/local where I keep local settings, so lets make that now:

    Code:
    sudo gedit /etc/init.d/local
    Now paste the logitech_applet command, mine like the example above is:

    Code:
    echo "Setting up Logitech mouse..."
    logitech_applet -s 800 -e
    I have the echo line so I can check if it works in the boot messages, it's nice but you don't need it.

    To make it executable run the following command:
    Code:
    sudo chmod 755 /etc/init.d/local
    Now run the following command to make the "local" script run when the system boots:
    Code:
    sudo update-rc.d local defaults
    Now the applet loads automatically on boot, huzzah!
    Conclusion

    I think that's everything, phew, this was longer than I expected. I hope it works for you and I haven't made too many mistakes. Please add any corrections and success stories for logitech mice other then the mx510 so we can find out what works.

    Thanks to endy's howto, and http://floam.sh.nu/guides/mx1000
    Please tell me if you have any problems or if I made any errors.

    Edit: Fixed the udev rule code, thanks Rizado and khedron.
    Edit: Fixed the path to xvkbd, thanks to XomboX
    Edit: Added two packages that need to be installed for click to be compiled.
    Edit: Added another package that needs to be installed for click to be compiled.
    Edit: Changed the URL for the logitech_applet, the one on freshmeat seems to be down, so I put it on my site.
    Edit: Added the requirement for build-essential for compiling click.
    Last edited by detyabozhye; July 21st, 2006 at 06:49 PM.
    aka anime4christ (I'm a guy, btw.)
    My personal boring website ^_^
    Jesus has changed your life. Save changes? (Y/N)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •