Compiz Fusion and a WiiMote!

Here is a video of our beloved Compiz Fusion being controlled by a WiiMote.

Sorry about the lack of updates on the blog recently, I have been quite busy but there is a lot of new stuff to talk about 🙂

Anyways, for the howto. Most of the instructions are on the video but here are some prerequisites:

  • First of all, Compiz Fusion if you don’t have it already
  • You’ll need a working Wii Remote too. Nintendo sells these separately from the Wii Console if you don’t have one (Which is good, due to the Wii Shortage that there is now ;-))
  • You’ll need a working bluetooth interface too. I found that my integrated bluetooth card just did not want to work, so I went a bought an external adapter. The cheapest I could find was around 50 Australian Dollars, don’t know about anywhere else. You can check to see if your Bluetooth works later in this post.
  • Finally, you need to go get libwiimote from the CWiiD project.
  • Once that is compiled an installed we need to check a few things:
dmesg | grep Bluetooth

Should yield something like:

Bluetooth: Core ver 2.11
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
Bluetooth: HCI USB driver ver 2.9
Bluetooth: L2CAP ver 2.8
Bluetooth: L2CAP socket layer initialized
Bluetooth: RFCOMM socket layer initialized
Bluetooth: RFCOMM TTY layer initiali ...

If it doesn’t , execute

sudo modprobe bluetooth

If it still doesn’t, trying installing bluez firmware,

If it *still* doesn’t then you will have to get a new bluetooth adaptor.

Once bluetooth is working, you need to do the following

sudo modprobe uinput wminput

(Note that modprobe and wminput are separate comamnds, but wordpress likes to murder the line break :-|)

Turn of your Wii Console off if it is on, and hold down (1)+(2) on your remote. Once it says ‘Ready’, you should be able to move the mouse around by tilting the remote. If you have a wireless sensor bar, a pair of infra-red lights or some candles, you can use

wminput -c ir_ptr

to enable the infra-red camera. Note that this doesn’t play so nice with compiz because as soon as you rotate the cube, the cursor will warp and be out of sync with the WiiMote.

Here is a video of it in action

– SmSpillaz


17 thoughts on “Compiz Fusion and a WiiMote!

  1. wminput give me :

    Put Wiimote in discoverable mode now (press 1+2)…
    No Bluetooth interface found
    unable to connect

    And I have, for dmesg | grep Bluetooth :
    [ 54.512205] Bluetooth: Core ver 2.11
    [ 54.512936] Bluetooth: HCI device and connection manager initialized
    [ 54.512949] Bluetooth: HCI socket layer initialized
    [ 54.548915] Bluetooth: L2CAP ver 2.8
    [ 54.548924] Bluetooth: L2CAP socket layer initialized
    [ 54.578873] Bluetooth: RFCOMM socket layer initialized
    [ 54.579548] Bluetooth: RFCOMM TTY layer initialized
    [ 54.579558] Bluetooth: RFCOMM ver 1.8

    What’s the problem ? 😉

  2. I feel like you could really do some neat stuff with a wii remote as an input device. For example, you could tie minimization or “shelving” to a quick flick of the wrist towards the outside, away from the screen screen, like you’re tossing the window away. A flick inside could be used to shuffle through windows. A flick forward could be the replacement for clicking. Its a control paradigm that might be better than the mouse, or at least a nifty compliment to it.

  3. haha, pretty neat!
    from the looks of it, you are in a pretty neifty room.
    Might want to un-shine your screen abit

  4. Just wondering. The wiimote headtracking can also be made through a simple webcam using opencv.
    I’ve got an old video about that here http://danielbaggio.blogspot.com/2008/01/webcam-opengl-opencv-head-tracking.html

    I’m now able to easily do 50 fps with an option to recognize a single head.
    Besides that, I’ve seen that eyetracking is also possible with the webcam.
    Just wondering if applying this idea to Compiz would be interesting.
    What do you think?
    Seeing the whole desktop as it really would look as soon as you get your head around. Maybe for scientific applications… 🙂

Leave a comment