2026-05-01 10:26:41 +01:00
# Anti Prestige Tool
2026-05-01 13:05:49 +01:00
Queue-position reader for Arma Reforger on Linux.
2026-05-01 10:26:41 +01:00
2026-05-01 13:05:49 +01:00
The tool captures the Reforger queue screen, crops the queue-number region, and reads the orange UI digits with a small built-in matcher. It does not use Tesseract, OpenCV, or Pillow.
2026-05-01 10:26:41 +01:00
2026-05-01 13:05:49 +01:00
## Install
Install system dependencies:
2026-05-01 10:26:41 +01:00
```bash
2026-05-01 13:05:49 +01:00
# Arch example
sudo pacman -S --needed base-devel uv qt6-base gstreamer gst-plugins-base gst-plugin-pipewire imagemagick xdg-desktop-portal
2026-05-01 10:26:41 +01:00
```
2026-05-01 13:05:49 +01:00
You also need a portal backend for your desktop:
2026-05-01 10:26:41 +01:00
```text
2026-05-01 13:05:49 +01:00
KDE: xdg-desktop-portal-kde
GNOME: xdg-desktop-portal-gnome
wlr: xdg-desktop-portal-wlr
2026-05-01 10:26:41 +01:00
```
2026-05-01 13:05:49 +01:00
Build the local helpers:
2026-05-01 10:26:41 +01:00
```bash
2026-05-01 13:05:49 +01:00
make
2026-05-01 10:26:41 +01:00
```
2026-05-01 13:05:49 +01:00
No sudo install is required for the default Portal/PipeWire capture path.
2026-05-01 10:26:41 +01:00
2026-05-01 13:25:01 +01:00
The digit matcher uses ImageMagick to render reference digits. By default it auto-selects an installed font, preferring Roboto Condensed when present and falling back to common system fonts such as DejaVu Sans.
2026-05-01 13:05:49 +01:00
## Use
2026-05-01 10:26:41 +01:00
2026-05-01 13:05:49 +01:00
Preferred command:
2026-05-01 10:26:41 +01:00
2026-05-01 13:05:49 +01:00
```bash
uv run reforger_queue_read.py --portal-window --show-crop --debug
2026-05-01 10:26:41 +01:00
```
2026-05-01 13:05:49 +01:00
On first run, your desktop should show a window-sharing picker. Select the Arma Reforger window. If the portal grants persistence, the tool stores a restore token here:
2026-05-01 10:26:41 +01:00
```text
2026-05-01 13:05:49 +01:00
~/.local/state/anti-prestige-tool/portal-window-restore-token
2026-05-01 10:26:41 +01:00
```
2026-05-01 13:05:49 +01:00
Later runs reuse that token:
2026-05-01 10:26:41 +01:00
2026-05-01 13:05:49 +01:00
```bash
uv run reforger_queue_read.py --portal-window --show-crop --debug
2026-05-01 10:26:41 +01:00
```
2026-05-01 13:05:49 +01:00
If the saved window selection is wrong or stale:
2026-05-01 10:26:41 +01:00
```bash
2026-05-01 13:05:49 +01:00
uv run reforger_queue_read.py --portal-window --portal-reselect --show-crop --debug
2026-05-01 10:26:41 +01:00
```
2026-05-01 13:05:49 +01:00
Save the captured input image while debugging:
2026-05-01 10:26:41 +01:00
2026-05-01 13:05:49 +01:00
```bash
uv run reforger_queue_read.py --portal-window --save-input /tmp/apt-portal-window.png --show-crop --debug
2026-05-01 10:26:41 +01:00
```
2026-05-01 13:25:01 +01:00
If font matching is weird on a specific machine, pass an installed ImageMagick font explicitly:
```bash
uv run reforger_queue_read.py --portal-window --font DejaVu-Sans-Condensed --show-crop --debug
```
2026-05-01 13:05:49 +01:00
## Optional KDE/KWin Mode
2026-05-01 10:26:41 +01:00
2026-05-01 13:05:49 +01:00
KWin mode can automatically find the Arma window by KWin metadata and can rebind after the game restarts. It is KDE-specific and requires installing an authorized helper.
2026-05-01 10:26:41 +01:00
2026-05-01 13:05:49 +01:00
Install the helper:
2026-05-01 10:26:41 +01:00
2026-05-01 13:05:49 +01:00
```bash
sudo make install-kwin-auth
kbuildsycoca6
2026-05-01 10:26:41 +01:00
```
2026-05-01 13:05:49 +01:00
Run:
2026-05-01 10:26:41 +01:00
2026-05-01 13:05:49 +01:00
```bash
uv run reforger_queue_read.py --kwin-window auto --show-crop --debug
2026-05-01 10:26:41 +01:00
```
2026-05-01 13:05:49 +01:00
If auto matching is ambiguous, list windows and pass the PID or internal id:
2026-05-01 10:26:41 +01:00
```bash
2026-05-01 13:05:49 +01:00
uv run reforger_queue_read.py --list-kwin-windows
uv run reforger_queue_read.py --kwin-window 53561 --show-crop --debug
uv run reforger_queue_read.py --kwin-window-id '{77a38955-a827-479c-971b-af8de226ac7b}' --show-crop --debug
2026-05-01 10:26:41 +01:00
```
2026-05-01 13:05:49 +01:00
The auth install places:
2026-05-01 10:26:41 +01:00
```text
2026-05-01 13:05:49 +01:00
/usr/local/bin/reforger-kwin-capture
/usr/local/share/applications/org.codex.reforger-kwin-capture.desktop
2026-05-01 10:26:41 +01:00
```
2026-05-01 13:05:49 +01:00
The desktop file must be in a root-owned application directory because KWin does not trust user-writable desktop entries for restricted screenshot interfaces.
2026-05-01 10:26:41 +01:00
2026-05-01 13:05:49 +01:00
## Other Inputs
2026-05-01 10:26:41 +01:00
2026-05-01 13:05:49 +01:00
Read an existing screenshot:
2026-05-01 10:26:41 +01:00
```bash
2026-05-01 13:05:49 +01:00
uv run reforger_queue_read.py --image /path/to/screenshot.png --show-crop --debug
2026-05-01 10:26:41 +01:00
```
2026-05-01 13:05:49 +01:00
Use Spectacle/KDE screen capture:
2026-05-01 10:26:41 +01:00
```bash
2026-05-01 13:05:49 +01:00
uv run reforger_queue_read.py --capture --screen DP-3 --show-crop --debug
2026-05-01 10:26:41 +01:00
```
2026-05-01 13:05:49 +01:00
Use an OBS scene screenshot:
2026-05-01 10:26:41 +01:00
```bash
2026-05-01 13:05:49 +01:00
uv run reforger_queue_read.py --obs-scene APT --show-crop --debug
2026-05-01 10:26:41 +01:00
```
2026-05-01 13:05:49 +01:00
Validate the included dataset:
2026-05-01 10:26:41 +01:00
```bash
2026-05-01 13:05:49 +01:00
uv run reforger_queue_read.py --dataset datasets/scootz-dataset --show-crop
2026-05-01 10:26:41 +01:00
```
2026-05-01 13:05:49 +01:00
Expected current output:
2026-05-01 10:26:41 +01:00
2026-05-01 13:05:49 +01:00
```text
datasets/scootz-dataset/1920x1080.png crop=788,465,75,45
datasets/scootz-dataset/1920x1080.png 22
datasets/scootz-dataset/2160x1440.png crop=1050,620,100,60
datasets/scootz-dataset/2160x1440.png 24
2026-05-01 10:26:41 +01:00
```
2026-05-01 13:05:49 +01:00
## Notes
2026-05-01 10:26:41 +01:00
2026-05-01 13:05:49 +01:00
Default crop reference:
2026-05-01 10:26:41 +01:00
2026-05-01 13:05:49 +01:00
```text
reference-size: 2560x1440
reference-crop: 1050,620,100,60
scale-mode: width
2026-05-01 10:26:41 +01:00
```
2026-05-01 13:05:49 +01:00
Portal/PipeWire is easiest to install, but restore behavior depends on the desktop portal. If the selected window disappears after an Arma restart, the portal may show the picker again.
2026-05-01 10:26:41 +01:00
2026-05-01 13:05:49 +01:00
KWin mode is the best KDE automation path, but it has the extra authorization install step.