Wi-Fi

Set up a bluetooth keyboard and mouse in Fedora 10

Fedora 10 provides better support for bluetooth peripherals and makes them easier to configure. Vincent Danen walks you through the Bluetooth Device Wizard and also provides tips for setting them up from the command line.

There is something to be said about the convenience of using a wireless keyboard and mouse, especially when using them with a laptop. They're easy to manage, easy to move, and easy to "disconnect" when you take the laptop away. There are two different types of wireless keyboards and mice: radio frequency (including bluetooth) and infrared.

Setting up bluetooth peripherals in Linux used to be a pain. It would involve working with command-line programs and editing text files. With Fedora 10, this is largely a thing of the past.

Out of the box, Fedora supports bluetooth peripherals like keyboards and mice and makes them simple to configure. When logging into GNOME, an icon for the bluetooth manager will sit at the top-right of the screen (if the system has bluetooth hardware, of course). Clicking on it provides the option to set up a new device; right-clicking does the same, but also allows you to set preferences, as well as send and receive files from bluetooth devices.

Clicking on "setup new device" will start the Bluetooth Device Wizard. On the bluetooth device there may be a "connect" type button to put it into discoverable mode. If it does, push the button and click the Forward button. The next screen will show a list of all the bluetooth devices found. Simply click on the device and, if the device is capable of entering a PIN, enter the PIN displayed on the screen. The device will now be connected.

If, however, you are using an older distribution, or a different distribution that doesn't have things set up quite the same, you may have to do it old school. It's not so painful as to not be worth mentioning, but certainly isn't as convenient.

To scan for bluetooth devices from the command-line, use:

$ hcitool scan
Scanning ...
        00:07:61:BC:A2:48 Logitech MX Revolution Mouse
        00:07:61:C3:86:B9 Logitech Revolution 5500

The hcitool program will print out a list of devices that it does not already know about (so running this on a system with paired peripherals already will not display them). Make note of the device ID (similar to an ethernet MAC address). Next, open /etc/bluetooth/hcid.conf in your favourite text editor; the location may differ depending on the distribution, so if you cannot find it, try executing find /etc -name hcid.conf.

At the bottom of the file, add a new entry for your bluetooth device:

device 00:07:61:BC:A2:48 {
    name "Logitech MX Revolution Mouse";
}
device 00:07:61:C3:86:B9 {
    name "Logitech Revolution 5500";
    auth enable;
    encrypt enable;
}

Restart the bluetooth service (usually "service bluetooth restart"), and then you can finish off the process by pairing the devices. Now execute:

# hidd --search

It will indicate the devices it found and will attempt to pair them. You may have to enter a PIN code on the keyboard; when I set this up with Red Hat Enterprise Linux 5, I did not have to, so this may depend on the distribution.

At this point, your bluetooth devices will be paired and the connection information should persist across reboots. It may take a few seconds of typing a key or wiggling the mouse to "wake up" the connection after booting, but there should be no need to reconfigure once they are paired.

Obviously, using the bluetooth applet in GNOME is much easier, and I suspect KDE must have something to make it fairly straightforward as well, but if the tools don't work or don't work well enough, using the command-line will definitely do the trick.

Get the PDF version of this tip here.

Delivered each Tuesday, TechRepublic's free Linux and Open Source newsletter provides tips, articles, and other resources to help you hone your Linux skills. Automatically sign up today!

About

Vincent Danen works on the Red Hat Security Response Team and lives in Canada. He has been writing about and developing on Linux for over 10 years and is a veteran Mac user.

2 comments
dogknees
dogknees

I'm curious about Linux, but I'm scared of losing the ability to customise the behaviour of the mouse and kb using a simple point and click interface. I currently use uberOptions for my devices and have customised behaviour that's different for each app I use. Do equivalent (similar capabilities and interface) apps exist for Linux? I'm also curious as to whether the "known issue" between MX air and diNovo kbs happens in Linux. That is, you can't have both volume controls active, or neither work reliably. Thanks

csmith.kaze
csmith.kaze

not sure about your second question, but I am pretty sure there are at least a few built-in macro editors in most distros and I am sure you can find something like "uberOptions" in any of the distro's repositories. I never was one for macros. If i need to finish a task faster, I usually just drop into command line. I guess tab is my macro :). Losing macro function is definitely not a deal breaker for me, though. I looked up uber options, seems to rely on setpoint software. maybe you can get setpoint to work in wine? nothing like trying it for yourself to see!

Editor's Picks