Development version

Using

Raw bluetooth mode

Prior to bluez 5.14 it was not possible to pair with the DS4. Therefore this
workaround exists which connects directly to the DS4 when it has been started
in pairing mode (by holding Share + PS until the LED starts blinking rapidly).

Hidraw mode

Note: Unfortunately due to a kernel bug it is currently not possible to use
any LED functionality when using bluetooth devices in this mode.

Permissions

ds4drv uses the kernel module uinput to create input devices in user land and
module hidraw to communicate with DualShock 4 controllers (when using
--hidraw), but this usually requires root permissions. You can change the
permissions by copying the udev rules file to
/etc/udev/rules.d/.

You may have to reload your udev rules after this with:

$ sudo udevadm control --reload-rules
$ sudo udevadm trigger

Configuring

Configuration file

The preferred way of configuring ds4drv is via a config file.
Take a look at ds4drv.conf for example usage.

ds4drv will look for the config file in the following paths:

~/.config/ds4drv.conf

/etc/ds4drv.conf

… or you can specify your own location with --config.

Command line options

You can also configure using command line options, this will set the LED
to a bright red:

$ ds4drv --led ff0000

See ds4drv --help for a list of all the options.

Multiple controllers

ds4drv does in theory support multiple controllers (I only have one
controller myself, so this is untested). You can give each controller
different options like this:

$ ds4drv --led ff0000 --next-controller --led 00ff00

This will set the LED color to red on the first controller connected and
green on the second.

Known issues/limitations

The controller will never be shut off, you need to do this manually by
holding the PS button until the controller shuts off

No rumble support

References

The DualShock 4 report format is not open and had to be reverse engineered.
These resources have been very helpful when creating ds4drv: