Skip to content

Contributing

QPfixxy edited this page Nov 21, 2026 · 2 revisions

Contributing

Bug reports, game reports and pull requests are welcome.

Reporting a game RigSwap gets wrong

If RigSwap misses a game's settings, or adds the wrong files:

  1. Open an issue with the game's name, your OS, and where its settings really are.
  2. If the game is in the game config database with a wrong or missing path, fixing it on PCGamingWiki (under Configuration file(s) location) helps every tool that uses the data, and reaches RigSwap at the next update.

Development setup

git clone https://github.com/QPfixxy/RigSwap.git
cd RigSwap
python3 -m venv .venv
source .venv/bin/activate          # Windows: .venv\Scripts\activate
pip install -e ".[dev]"
pytest                             # set QT_QPA_PLATFORM=offscreen on a headless machine
ruff check .

CI runs the tests and lint on Windows and Ubuntu with Python 3.11 and 3.13.

Building installers

pip install -e ".[build]"
  • Windows: powershell -ExecutionPolicy Bypass -File packaging\windows\build.ps1 -Arch x64 (or arm64). Needs Inno Setup 6. Output: dist\RigSwap-<version>-windows-<arch>-setup.exe.
  • Linux: packaging/linux/build-appimage.sh. Output: dist/RigSwap-<version>-linux-<arch>.AppImage.

Both use PyInstaller (packaging/pyinstaller/rigswap.spec), which builds two programs in one folder: RigSwap (the app) and rigswap-cli (the command line; not rigswap, because Windows file names ignore case).

Releases

  1. Set the version in src/rigswap/__init__.py (e.g. 2.1.0, or 2.1.0a1 for a pre-release).
  2. Commit, then tag and push: git tag v2.1.0 && git push origin v2.1.0.
  3. GitHub Actions builds Windows x64/ARM64 and Linux x86_64/aarch64 and creates a draft release. Check it, then press Publish.

Code layout

src/rigswap/
  core/
    models.py      setups, games, config locations, snapshots, settings
    store.py       saving the library (atomic, with a .bak)
    swap.py        saving, switching, backups, rollback, undo, restore
    detect.py      finding config files (game database + engine rules)
    engines.py     Unreal, Unity and Source rules
    learn.py       Learn mode
    manifest.py    the game config database (download, index, lookup)
    registry.py    Windows registry and Wine prefix registry files
    steam.py       Steam libraries, games and Proton prefixes
    auto.py        automatic switching (rules, settling, waiting for games)
    autostart.py   starting at login
    processes.py   is a game running?
    instance.py    lets the Windows installer see that RigSwap is running
  hardware/        GPUs, power and displays (windows.py, linux.py)
  launchers/       Epic, GOG, Game Bar (windows.py), Heroic, Lutris (linux.py)
  gui/             PySide6 app
  cli.py           the rigswap command
packaging/         PyInstaller spec, Windows installer, AppImage
tests/

core/ has no GUI code; the app and the command line are thin layers on top of it.

Guidelines

  • Safety first. Anything that writes to a game's files goes through swap.py, so it gets the running-game check, backups, atomic writes and undo.
  • No administrator rights, ever.
  • Tests with every change. Tests use temporary folders and fake processes, and never touch real game files or the real registry (except a clearly named test key on Windows).
  • Original code. RigSwap is GPL-3.0. Ideas, file formats and public data are fine; don't copy code from other projects.
  • Keep it working on both Windows and Linux.

Clone this wiki locally