Using a Dual Shock 3 controller with Steam on Linux via bluetooth

I was really surprised as to how easy this ended up being.

Setup

Open up your favourite terminal, and type bluetoothctl.

Next connect your controller by USB and you should be prompted as to whether you trust the device, type ‘yes’.

Disconnect the USB cable and press the PS button on the controller.

After a few flashes of the leds it should pair successfully.

You can repeat the above procedure for additional controllers as required.

Disconnecting

The next problem is how to disconnect the controller without needing to turn off bluetooth or power off your computer.

Back to the terminal and a simple command will disconnect all connected controllers, saving your precious battery.

bluetoothctl devices | awk '{print $2'} | xargs -I{} bluetoothctl disconnect {}

Let’s break this down.

Breakdown

bluetoothctl devices will list all connected devices

All we care about is the id of the controller so piping the output to awk we can map only second element (the id).

Next pipe the id’s back to the bluetoothctl command and disconnect the controller.

Nice and easy and you could even map this command to keyboard shortcut. I’ve simply created a bash alias, ds3disconnect to save my fingers.

Steam should detect the controller without a hitch and you can get some wireless Session flip trick goodness.