Results 1 to 10 of 650

Thread: HOWTO: Configuring Logitech mice in Ubuntu 6.06: New Guide

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.10 and 7.04

    70.06.19: I've made a major update to this guide for Ubuntu 6.10 and 7.04. Tell me if I made any mistakes.

    A COMPLETE guide to a Logitech mouse

    Note: Some have complained that this guide is too complicated (they should see the old guide, about twice the length). Well, I won't argue, but I'd like to point out that sections 2 and 3 are optional and there is an alternative method for Section 1 as well, but my method will greatly increase the functionality of the mouse.

    This is my guide on how to get all the buttons working properly on a logitech mouse (loosely based on Endy's guide), how to use lmctl 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, it should work for the similar mx510 and mx518 and the wireless versions like the mx700 however, they may require slightly different configurations. Higher models, such as the MX1000 and the G series definatley need config changes, especially in the xbindkeys area.

    Prerequisite: Installing evdev

    Evdev was installed by default on my system, but some people didn't have it installed by default. So if you don't, run this command to install it:

    Code:
    sudo apt-get install xserver-xorg-input-evdev

    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.

    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"

    2. Adding a udev rule

    Adding a udev rule in MOST cases is not necessary anymore, therefore it has been removed.

    3. Editing the xorg.conf file

    First, let's back it up in case you mess anything up:

    Code:
    sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak
    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 replace it with:

    Code:
    Section "InputDevice"
    	Identifier	"Configured Mouse"
    	Driver		"evdev"
    	Option		"CorePointer"
    	Option		"Name"	"Logitech USB-PS/2 Optical Mouse" #this should be the name of the device which I made bold here.
    EndSection
    Make sure you save the changes to your xorg file.

    4. Restart udev and Xorg

    Warning!
    Don't restart yet! Just before we do I have to warn you if you made a mistake in the xorg file X will not start. But don't worry that's why we backed up the previous file. If X fails to start then you will end up in a text console. Log in and type the following to rename the current xorg.conf and restore the previous file:

    Code:
    sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf-logi
    sudo mv /etc/X11/xorg.conf.bak /etc/X11/xorg.conf
    Ok, I'm ready
    Now we're prepared, restart evdev by typing:
    Code:
    sudo /etc/init.d/udev restart
    Then restart Xorg by logging out and pressing Alt+Ctrl+Backspace. Then log back in.

    Section 2: Side buttons and Nautilus, Epiphany, Konqueror, etc (Optional)

    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 (for MX500, MX510, MX518, MX700):

    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
    For mice with a tilt wheel (such as the MX1000), you would most likely change b:6 to b:8 and b:7 to b:9.

    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.

    2. Fixing the cruise control buttons (MX500, MX510, MX700, MX1000):

    Note: In Edgy and Feisty I haven't noticed this problem anymore (I've had cruise control off for a while though), but I will leave this section here because it hasn't been confirmed that the problem is gone.

    Install these packages for "click" to compile:

    Code:
    sudo apt-get install build-essential libx11-dev x11proto-xext-dev libxtst-dev
    Download and untar "click" source code into ~/.click (or wherever you want, just remember the dir, you'll need it in the .xbindkeysrc):

    Code:
    cd ~/
    wget http://bg.rifetech.com/click.tgz
    tar xvfz click.tgz
    mv click .click
    then compile it:

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

    Code:
    "~/.click/click 4"
      m:0x0 + b:9
    "~/.click/click 5"
      m:0x0 + b:10
    Note: Mice with more buttons and/or tilt wheels will most likely have different button numbers, please check in xev.

    3. 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.

    In KDE (Thanks to msak007), you create a startup script:
    Code:
    kedit ~/.kde/Autostart/start-xbindkeys
    Insert this into it:
    Code:
    #!/bin/sh
    xbindkeys
    Make it executable:
    Code:
    chmod +x ~/.kde/Autostart/start-xbindkeys

    Section 3: lomoco (Resolution, etc.) (Optional)

    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.

    1. Getting everything we need

    lomoco is in the repositories as of Ubuntu 6.10. Ok so lets install lomoco:

    Code:
    sudo apt-get install lomoco
    2. Working lomoco

    I use the command "lomoco -8" which you can run now:

    Code:
    sudo lomoco -8
    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 lomoco command, mine like the example above is:

    Code:
    echo "Setting up Logitech mouse..."
    lomoco -8
    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 lomoco loads automatically on boot!

    Conclusion

    I think that's everything, phew. 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 mx500 so we can find out what works.

    Thanks to endy's howto, http://floam.sh.nu/guides/mx1000, and the many people who responded to my first howto, especially pietruszka.
    Please tell me if you have any problems or if I made any errors.

    Edit: Added the need to restart the whole computer for the udev rule to take effect. I think this is where many people had trouble with my last guide.
    Edit: Simplified the click downloading and all.
    Edit: Added a few notes for those who complain.
    Edit: Fixed the click path for xbindkeys.
    Edit: Added the requirement for the evdev package since not everybody has it installed by default.
    Edit: Replaced LMCtl with lomoco in the instructions
    Edit: Fixed a most embarrasing error in the note at the top.
    Edit: Added the KDE way to add xbindkeys to the session.
    Edit: Did a major upgrade for Edgy and Feisty.
    Edit: Replaced the restart part with a command to restart evdev and Xorg.
    Last edited by detyabozhye; August 29th, 2007 at 06:05 AM. Reason: Updated for new realeases of Ubuntu
    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
  •