This page provides information on connecting a Sony PS3 Sixaxis or DualShock 3 Joystick via Bluetooth and configuring Ubuntu to use it in a variety of environments.
Sixaxis - Community Ubuntu Documentation