This script makes a fake ps3 controller connect on linux as a gamepad (shows as Xbox 360 for me). More details here probably
fixcontroller.py is adapted from https://gist.github.com/dnmodder/de2df973323b7c6acf45f40dc66e8db3
You probably want to check that the script works correctly before you follow the steps below to make the changes permanent.
chmod +x fixcontroller.py
cp fixcontroller.py /usr/local/bin/fixcontroller.py
cp 01-fixps3.rules /etc/udev/rules.d
udevadm control --reload