This is a small python program which calibrates the R3 Reaper Lightgun on Linux; instead of using the (Windows Only) utility from the manufacturer.
I made this utility for myself, for use on Bazzite Linux (like SteamOS). I am open-sourcing it as it utilises some GPL code from the Batecera Linux Distribution, and it may be helpful to others.
You should install it first, and then you can launch calibrate.sh from your favourite launcher, to calibrate the lightgun.
It works the same as the other utilities, you point the gun at targets on the screen, and fire. The gun's internal firmware
is then programmed and the calibration is 'commited'.
There is a config.toml next to calibrate.py, this controls the behaviour of the calibration utility.
example:
[display]
x_resolution = 1920
y_resolution = 1080
dpi_scaling = 1
[gun]
player=1
calibration_target="Mouse"
[calibration]
target_size=100If your gun registers as 'player 2' (my gray gun), then setting player=2 will calibrate that one.
- The code is low quality, as I ported from Batecera's codebase and did not want to mess with the application logic too much.
You will need your user to be able to write to the raw HID device files on the machine, and control the display (if this is arcane to you, just follow the steps). On Bazzite, this is not required, but it is on, for example Arch.
sudo groupadd plugdev
sudo nvim /etc/udev/rules.d/99-hidraw-permissions.rules
Adding this text:
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0660", GROUP="plugdev"
and saving.
sudo usermod -a -G plugdev YOUR_USERNAME_DONT_COPY_ME_YOU_SILLY_GOOSE
then reboot with sudo reboot.
We rely on evtest, python3-devel, pkg-config and raylib.
These will need to be installed from your distro's repos before setting up your python virtual environment. I'm happy
to take pull requests for installation commands.
The calibrate shell script will toggle to the python venv for you, but this is how you set it up. Change
directory to the location of calibrate.sh and run these commands:
python3 -m venv .venv
source .venv/bin/activate
pip3 install -r requirements.txt
In the root of the repo directory, run the installer for the dependencies
./install_dependencies.sh
