Add joystick offset

This commit is contained in:
askiiart 2024-03-07 11:15:05 -06:00
parent 370b500cbc
commit 87fecccad4
Signed by untrusted user who does not match committer: askiiart
GPG key ID: BC3800E55FB54D67
2 changed files with 21 additions and 2 deletions

View file

@ -32,6 +32,8 @@ in
pkgs.dbus
pkgs.xdg-utils
pkgs.spamassassin
#pkgs.docker
pkgs.linuxConsoleTools
];
# enable spamd
@ -188,7 +190,9 @@ in
# enable more codecs
hardware.bluetooth.settings = {
General = {
Enable = "Source,Sink,Media,Socket";
Enable = "Source,Sink,Media";
Disable = "Socket";
MultiProfile= "multiple";
};
};
hardware.pulseaudio = {
@ -207,4 +211,20 @@ in
# fix Steam glXChooseVisual failed
hardware.opengl.driSupport32Bit = true;
# "fix" broken gamepad
#services.cron = {
# enable = true;
# systemCronJobs = [
# "* * * * * root evdev-joystick --e /dev/input/by-id/usb-ShanWan_Xbox360_For_Windows_10F36D6-event-joystick --minimum -32767 --maximum 0 --a 3; evdev-joystick --e /dev/input/by-id/usb-ShanWan_Xbox360_For_Windows_10F36D6-event-joystick --minimum 0 --maximum 32767 --a 4"
# ];
#};
systemd.services.fix-gamepad = {
enable = true;
unitConfig.Type = "simple";
description = "fix the gamepad by adding offset to the right stick";
serviceConfig.ExecStart = "/run/current-system/sw/bin/bash -c 'while true; do /run/current-system/sw/bin/evdev-joystick --e /dev/input/by-id/usb-ShanWan_Xbox360_For_Windows_10F36D6-event-joystick --minimum -32767 --maximum 0 --a 3; /run/current-system/sw/bin/evdev-joystick --e /dev/input/by-id/usb-ShanWan_Xbox360_For_Windows_10F36D6-event-joystick --minimum 0 --maximum 32767 --a 4; sleep 5; done'";
wantedBy = [ "multi-user.target" ];
};
}

View file

@ -42,7 +42,6 @@ in
pkgs.python312
pkgs.blueman
pkgs.dnsutils
pkgs.docker
pkgs.gnome.gnome-keyring
pkgs.pandoc
pkgs.cinny-desktop