Add MTGA Assistant: native Linux deck and game tracker
PySide6 app that follows MTG Arena's Player.log under Steam/Proton and shows my remaining library with draw odds, my zones, and everything revealed about the opponent (board, graveyard, exile, known hand/library, seen this match). - Auto-detects the Steam library, Proton prefix log and MTGA install - Card names/costs/types from MTGA's local SQLite card database - Tracks card identity across zone changes, shuffles and Bo3 games - Scryfall card images with a lazy, size-capped LRU disk cache - Live log following with restart detection, plus --replay mode - Flags log gaps where MTGA omits oversized game-state messages Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
734336168c
commit
7dc2ce0da8
21 files changed
+2736
No files matched your search
@@ -1,2 +1,64 @@
|
||||
# mtga-assistant
|
||||
|
||||
A native Linux deck and game tracker for **Magic: The Gathering Arena** running under Steam/Proton.
|
||||
It follows MTGA's `Player.log`, much like Untapped.gg and other trackers do, and shows:
|
||||
|
||||
- **My deck**: remaining library with draw odds, hand, battlefield, graveyard, exile, sideboard.
|
||||
Between matches, it shows the last deck you submitted.
|
||||
- **Opponent**: battlefield, stack, graveyard, exile, cards *known* to be in their hand or library
|
||||
(cards you saw that went back into a hidden zone, or were revealed), and every card seen this match.
|
||||
- **Card preview**: hover a card to see its image from [Scryfall](https://scryfall.com).
|
||||
|
||||
Card names, mana costs and types come from MTGA's own local card database, so they work offline.
|
||||
|
||||
## Requirements
|
||||
|
||||
- MTGA installed through Steam (Proton). The log, install and card DB are auto-detected from your
|
||||
Steam library folders.
|
||||
- **Detailed logs enabled** in MTGA: *Options → Account → Detailed Logs (Plugin Support)*.
|
||||
- [uv](https://docs.astral.sh/uv/) (`pacman -S uv`).
|
||||
|
||||
## Running
|
||||
|
||||
```sh
|
||||
uv run mtga-assistant # follow the live Player.log
|
||||
uv run mtga-assistant --replay path/to/Player-prev.log --rate 40 # replay a saved log
|
||||
uv run pytest # tests
|
||||
```
|
||||
|
||||
Start it before or after MTGA: on startup it reads the existing log to catch up on a match in
|
||||
progress, then follows new lines. When MTGA restarts and replaces the log, the tracker resets.
|
||||
|
||||
On Wayland the window's app id is `mtga-assistant`. For example, to keep it floating on another
|
||||
workspace in Hyprland:
|
||||
|
||||
```
|
||||
windowrule = float, class:^(mtga-assistant)$
|
||||
windowrule = workspace 2, class:^(mtga-assistant)$
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
Optional: `~/.config/mtga-assistant/config.toml`
|
||||
|
||||
```toml
|
||||
log_path = "/path/to/Player.log" # override auto-detection
|
||||
mtga_dir = "/path/to/steamapps/common/MTGA"
|
||||
cache_max_mb = 500 # image cache cap
|
||||
```
|
||||
|
||||
## Image cache
|
||||
|
||||
Images are downloaded only for cards that actually appear, at Scryfall's `normal` size (about
|
||||
60–100 KB each), and stored in `~/.cache/mtga-assistant/images`. When the cache passes
|
||||
`cache_max_mb`, the least recently viewed images are deleted. *Cache → Clear image cache* empties it.
|
||||
|
||||
## Known limitations
|
||||
|
||||
- MTGA leaves oversized game-state messages out of the log ("Message summarized because one or
|
||||
more GameStateMessages exceeded the 50 GameObject or 50 Annotation limit"), typically during board
|
||||
wipes. Some zones can then be stale until they next change. The app detects this and shows a
|
||||
warning.
|
||||
- After a library shuffle, a known card's position in the opponent's library is lost. It stays listed
|
||||
under "Library … known" until it shows up again. If it is drawn without being revealed, it may
|
||||
stay listed.
|
||||
Reference in new issue
Block a user