1
0
Fork 0

Apps: try to fix PDP bluetooth controller not using xpadneo (spoilers: it's not fixed)

This commit is contained in:
Aires 2024-10-24 16:50:21 -04:00
parent adb928573c
commit 319771d8db

View file

@ -13,6 +13,10 @@ let
sudo rmmod hid_xpadneo && sudo modprobe hid_xpadneo
sudo systemctl restart bluetooth.service
'';
# FIXME: replace with real vendorID and product ID for Victrix Pro BFG controller
vendorID = "0e6f";
productID = "024b";
in
{
options = {
@ -32,6 +36,25 @@ in
# Enable Xbox controller driver (XPadNeo)
hardware.xpadneo.enable = true;
# Create udev rule to force PDP Victrix controller to use xpadneo
# Udev rule taken from https://github.com/atar-axis/xpadneo/blob/master/hid-xpadneo/etc-udev-rules.d/60-xpadneo.rules
# Also see https://www.reddit.com/r/linuxquestions/comments/rcx182/why_cant_i_write_to_sysbushiddriversxpadneonew_id/
services.udev.extraRules = ''
ACTION=="add", ATTRS{id/vendor}==${vendorID}, ATTRS{id/product}==${productID}, RUN+="${pkgs.bash}/bin/bash -c 'echo 0x03 ${vendorID} ${productID} > /sys/bus/hid/drivers/xpadneo/new_id && echo 0x05 ${vendorID} ${productID} > /sys/bus/hid/drivers/xpadneo/new_id'"
'';
/*
services.udev.packages = [
(pkgs.writeTextFile {
name = "victrix-pro-bfg.rules";
executable = true;
destination = "/etc/udev/rules.d/70-victrix-pro-bfg.rules";
text = ''
ACTION=="add", ATTRS{id/vendor}==${vendorID}, ATTRS{id/product}==${productID}, RUN+="${pkgs.bash}/bin/bash -c 'echo 0x03 ${vendorID} ${productID} > /sys/bus/hid/drivers/xpadneo/new_id && echo 0x05 ${vendorID} ${productID} > /sys/bus/hid/drivers/xpadneo/new_id'"
'';
})
];
*/
# Add script to restart xpadneo in case of issues
aux.system.packages = [ reset-controllers-script ];