Skip to content

Commit d53ec45

Browse files
committed
Add DualShock configuration script
1 parent 1d5d58b commit d53ec45

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# DualShock 3 over USB
2+
KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="0268", MODE="0666"
3+
4+
# DualShock 3 over Bluetooth
5+
KERNEL=="hidraw*", KERNELS=="*054C:0268*", MODE="0666"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# DualShock 4 over USB
2+
KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="05c4", MODE="0666"
3+
4+
# DualShock 4 Wireless Adapter over USB
5+
KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="0ba0", MODE="0666"
6+
7+
# DualShock 4 Slim over USB
8+
KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="09cc", MODE="0666"
9+
10+
# DualShock 4 over Bluetooth
11+
KERNEL=="hidraw*", KERNELS=="*054C:05C4*", MODE="0666"
12+
13+
# DualShock 4 Slim over Bluetooth
14+
KERNEL=="hidraw*", KERNELS=="*054C:09CC*", MODE="0666"
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env bash
2+
set -eu
3+
4+
# https://wiki.rpcs3.net/index.php?title=Help:Controller_Configuration#On_Linux
5+
6+
if [ "${EUID}" -ne 0 ]; then
7+
echo "This script should be run as root."
8+
exit 1
9+
fi
10+
11+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
12+
13+
apt-get update
14+
# You may also want to install bluez-tools, but in my experience it's not necessary.
15+
apt-get install bluez
16+
17+
echo "Copying udev rules."
18+
cp "${SCRIPT_DIR}/99-ds3-controllers.rules" "/etc/udev/rules.d/99-ds3-controllers.rules"
19+
cp "${SCRIPT_DIR}/99-ds4-controllers.rules" "/etc/udev/rules.d/99-ds4-controllers.rules"
20+
chmod 644 "/etc/udev/rules.d/99-ds3-controllers.rules" "/etc/udev/rules.d/99-ds4-controllers.rules"
21+
echo "Reloading udev rules."
22+
udevadm control --reload-rules
23+
24+
echo "Enabling PS3 controller pairing without PIN."
25+
# https://www.reddit.com/r/linux_gaming/comments/18p5mqu/ps3_controller_pin/
26+
# https://askubuntu.com/questions/1497783/why-does-official-ps3-bluetooth-controller-no-longer-work-and-pin-code-suddenly
27+
sed -i "s/#ClassicBondedOnly=true/ClassicBondedOnly=false/g" "/etc/bluetooth/input.conf"
28+
29+
echo "Restarting the Bluetooth service."
30+
systemctl restart bluetooth
31+
32+
echo "DualShock setup complete."

0 commit comments

Comments
 (0)