Controller goes in /usr/local/bin, and must be marked as executable.
The same is true with password_helper.sh.

In $HOME/b/xboxdrv, folders containing an xboxdrv script should be kept.
When you run Controller, use the name of the script, such as osrs.
For example, Controller osrs.
It will open the xboxdrv configuration file in the folder.

My controller is tuned. You can tune your Xbox 360 controller by looking at the output when you run xboxdrv with your controller connected. The exit_xboxdrv script should also be placed in /usr/local/bin.

If you run: sudo xboxdrv you can get the resting coordinates of the joysticks. Then you can calculate the minimum deadzone and offsets. Try flicking the joystick and letting it return to it's default location.

You might first have to run rmmod xpad, which is included in the Controller script. Check the file's text to see it. It's the Controller script that is used with the configuration file in the directory. The text of the script says:

sudo -A rmmod xpad > /dev/null 2>&1

You might need to run that first, but if you're going to do it on the command line to check the verbose output of xboxdrv, don't include the extra parts of the script. Simply run sudo rmmod xpad.

The controller must be tuned or else it will be off. The configuration file is for my controller.

Installation
------------
Place the files in the correct directory, as mentioned above.
Run the controller script with Controller PROFILE, where PROFILE is the name of the PROFILE.xboxdrv script, located in the folder PROFILE/.

Exiting the Script
------------------
Run exit_xboxdrv to exit the script.
Information: Normally you can leave the xboxdrv script open on the command line, but it has extra bash parameters that put it in the background, automatically provide the sudo password, and redirect it's output to /dev/null so you don't see anything on the command line.

ALSO
----
Change in the text of password_helper.sh to your password for sudo.
If you run on a secure system, you might have to enter the password yourself. I simply use the guest password for username guest. My passwords.txt file is encrypted. In Ubuntu 24.04 you can encrypt a zip file, and that's what I use to store my passwords. Delete the file after it's unzipped, and optionally for efficiency unzip it to /tmp so that when the computer turns off it is lost, since it is in system Random Access Memory as a temporary file.


Included
--------
My script for OSRS is included. You need to modify the joystick parameters if you want to use it. You might be able to set a deadzone, but the joysticks won't be tuned accurately. Unless you check the verbose output of sudo xboxdrv and adjust the values in osrs/osrs.xboxdrv yourself, the xbox 360 controller won't be tuned.

You might be able to use a different type of controller. This is an example of one I'm looking into:
https://a.co/d/btg2pcf

In order to use the script run sudo apt install xboxdrv. That is required.