No description
Find a file
2026-05-01 13:51:43 +01:00
datasets Use bundled digit templates by default 2026-05-01 13:51:43 +01:00
templates Use bundled digit templates by default 2026-05-01 13:51:43 +01:00
.gitignore Add portal window capture backend 2026-05-01 13:05:49 +01:00
.python-version initial v0.1 APT 2026-05-01 10:26:41 +01:00
kwin_capture_screen.cpp Add portal window capture backend 2026-05-01 13:05:49 +01:00
main.py initial v0.1 APT 2026-05-01 10:26:41 +01:00
Makefile Add portal window capture backend 2026-05-01 13:05:49 +01:00
org.codex.reforger-kwin-capture.desktop Add portal window capture backend 2026-05-01 13:05:49 +01:00
portal_capture_frame.cpp Add portal window capture backend 2026-05-01 13:05:49 +01:00
pyproject.toml initial v0.1 APT 2026-05-01 10:26:41 +01:00
README.md Use bundled digit templates by default 2026-05-01 13:51:43 +01:00
reforger_queue_read.py Use bundled digit templates by default 2026-05-01 13:51:43 +01:00
uv.lock initial v0.1 APT 2026-05-01 10:26:41 +01:00

Anti Prestige Tool

Queue-position reader for Arma Reforger on Linux.

The tool captures the Reforger queue screen, crops the queue-number region, and reads the orange UI digits with bundled real-game digit templates. It does not use Tesseract, OpenCV, or Pillow.

Install

Install system dependencies:

# Arch example
sudo pacman -S --needed base-devel uv qt6-base gstreamer gst-plugins-base gst-plugin-pipewire imagemagick xdg-desktop-portal

You also need a portal backend for your desktop:

KDE:   xdg-desktop-portal-kde
GNOME: xdg-desktop-portal-gnome
wlr:   xdg-desktop-portal-wlr

Build the local helpers:

make

No sudo install is required for the default Portal/PipeWire capture path. No specific font package is required for normal use.

Use

Preferred command:

uv run reforger_queue_read.py --portal-window --show-crop --debug

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:

~/.local/state/anti-prestige-tool/portal-window-restore-token

Later runs reuse that token:

uv run reforger_queue_read.py --portal-window --show-crop --debug

If the saved window selection is wrong or stale:

uv run reforger_queue_read.py --portal-window --portal-reselect --show-crop --debug

Save the captured input image while debugging:

uv run reforger_queue_read.py --portal-window --save-input /tmp/apt-portal-window.png --show-crop --debug

The default matcher uses templates/reforger_digits.json. Font mode is only for debugging:

uv run reforger_queue_read.py --portal-window --font Roboto-Condensed --show-crop --debug

Optional KDE/KWin Mode

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.

Install the helper:

sudo make install-kwin-auth
kbuildsycoca6

Run:

uv run reforger_queue_read.py --kwin-window auto --show-crop --debug

If auto matching is ambiguous, list windows and pass the PID or internal id:

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

The auth install places:

/usr/local/bin/reforger-kwin-capture
/usr/local/share/applications/org.codex.reforger-kwin-capture.desktop

The desktop file must be in a root-owned application directory because KWin does not trust user-writable desktop entries for restricted screenshot interfaces.

Other Inputs

Read an existing screenshot:

uv run reforger_queue_read.py --image /path/to/screenshot.png --show-crop --debug

Use Spectacle/KDE screen capture:

uv run reforger_queue_read.py --capture --screen DP-3 --show-crop --debug

Use an OBS scene screenshot:

uv run reforger_queue_read.py --obs-scene APT --show-crop --debug

Validate the regression set:

uv run reforger_queue_read.py --dataset datasets/regression-test-set --expect-filenames

Expected current result:

summary: 21 passed, 0 failed

Validate the smaller included dataset:

uv run reforger_queue_read.py --dataset datasets/scootz-dataset --show-crop

Expected current output:

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

Notes

Default crop reference:

reference-size: 2560x1440
reference-crop: 1050,620,100,60
scale-mode: width

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.

KWin mode is the best KDE automation path, but it has the extra authorization install step.