Hook reliability: - Add hook-errors = "warn" | "fail" setting (default: warn); in fail mode, abort launch when pre-launch hook exits nonzero or can't execute - Ensure post-launch hook runs unconditionally, even when execute_wait() fails to spawn the game - Propagate game's real exit status via std::process::exit(); report post-hook failures clearly to stderr - Centralize hook execution via run_hook() helper (sh -c) New features in this batch: - Sparse config and profile support: only configured fields are written; unset fields fall back through profile → global chain - config show --effective flag: renders the fully-resolved view - Config migration: upgrades legacy flat config to current schema - Structured decision logging (src/log.rs) for session-level audit trail - Gamescope improvements: additional flags and validation - CHANGELOG.md tracking template releases Schema / UX: - HookErrors enum (Warn/Fail) added to Settings and ResolvedSettings - hook-errors key in keys.rs, mod.rs rendering, completion candidates, doctor output, help text, README, and dry-run display - 9 focused tests covering warn/fail behavior, exit propagation, round-trip (set/show/reset), profile round-trip, export/import Co-Authored-By: claude-flow <ruv@ruv.net>
gamewrap
gamewrap is a small Linux launcher for Steam games that keeps Steam launch options short while managing MangoHud, GameMode, gamescope, launch hooks, and per-game history from readable local config.
The main idea is simple:
- keep Steam launch options short
- move behavior into a readable config file
- make common settings easy to understand and change
- provide diagnostics when a launch setup is broken
For a normal Steam setup, launch options can stay as short as:
gamewrap %command%
gamewrap stores its configuration outside Steam, supports reusable profiles, can bind specific executables to profiles, and tries to explain technical behavior in plain language instead of expecting users to remember environment variable names.
Features
- Short Steam launch options
- Friendly setting names like
mangohudandgamemode - Persistent config outside the Steam UI
- Named profiles for reusable setups
- Flat game-specific profiles layered on global defaults
- Game-specific profile binding through
game bind - Quick access to the last played game through
gamewrap last - Play time and launch count tracking per game
- Game notes for remembering per-title quirks
- Filtered game listing and fuzzy game lookup
- Observed game cleanup through
game forget - Config export/import for backup and sharing
- Direct config editing through
config edit - Profile export/import for sharing one setup at a time
- Per-profile environment variable overrides
- gamescope Wayland compositor integration
- FPS cap through MangoHud
- Pre-launch hooks
- vkBasalt and Proton esync/fsync/large-address-aware controls
- Graphical notification self-test
- Shell completion generation
doctor,status, anddry-runcommands for troubleshooting- explicit
runmode for command-name collisions - Clear help text with both plain-language explanations and technical details
Install
Recommended low-maintenance install:
cargo install --path . --force
This installs the binary to ~/.cargo/bin/gamewrap, which is already on PATH for most users who have Rust installed.
# After installing, ensure ~/.cargo/bin is on your PATH.
# Most Rust setups do this automatically. If gamewrap isn't found
# in Steam launch options, add to ~/.bash_profile or ~/.zprofile:
# export PATH="$HOME/.cargo/bin:$PATH"
After that, Steam launch options can stay simple:
gamewrap %command%
User-local install:
cargo install --path .
That installs the binary to ~/.cargo/bin/gamewrap.
If Steam cannot find commands from ~/.cargo/bin in your desktop session, use the full path in Steam launch options:
$HOME/.cargo/bin/gamewrap %command%
Quick Start
- Put this in Steam launch options:
gamewrap %command%
If Steam cannot find gamewrap by name, use:
$HOME/.cargo/bin/gamewrap %command%
- Turn MangoHud on by default:
gamewrap config set mangohud on
- Turn GameMode on by default:
gamewrap config set gamemode on
- Check your setup before launching a real game:
gamewrap doctor
- Launch a game explicitly from the terminal when needed:
gamewrap run /path/to/game/executable
Add -- only when the command or its arguments would otherwise look like gamewrap options.
- Inspect what
gamewrapwould do without actually launching:
gamewrap dry-run /path/to/game/executable
- Bind a known game executable to a profile:
gamewrap profile create benchmark
gamewrap game bind "Game.exe" benchmark
- Add game-specific overrides while keeping shared values global:
gamewrap config set mangohud on
gamewrap profile create benchmark
gamewrap profile set benchmark verbose on
- Export your config for backup or sharing:
gamewrap config export shared
- Export one profile for sharing:
gamewrap profile export benchmark benchmark
- Import a shared profile:
gamewrap profile import benchmark
- Install shell completions:
gamewrap completion install zsh
You can still print the raw script with gamewrap completion zsh, but install is the user-friendly path.
The installed completion script asks gamewrap for live data, so new profiles and observed games show up automatically without reinstalling.
If the real command you want to launch has the same name as a gamewrap subcommand, force launch mode with:
gamewrap run -- /path/to/game/executable
Common Commands
gamewrap --help
gamewrap help settings
gamewrap help settings gamescope
gamewrap help settings mangohud
gamewrap help doctor
gamewrap game list
gamewrap game list "elden"
gamewrap game show "Game.exe"
gamewrap game forget "Game.exe"
gamewrap status
gamewrap doctor
gamewrap notify test
gamewrap doctor /path/to/game/executable
gamewrap run /path/to/game/executable
gamewrap dry-run /path/to/game/executable
gamewrap completion zsh
gamewrap completion install zsh
gamewrap completion path zsh
gamewrap config show
gamewrap config show --effective
gamewrap config edit
gamewrap config reset --all
gamewrap config migrate
gamewrap config export shared
gamewrap config import shared
gamewrap last
gamewrap profile list
gamewrap profile create benchmark
gamewrap profile show benchmark
gamewrap profile show benchmark --effective
gamewrap profile duplicate benchmark benchmark-copy
gamewrap profile export benchmark benchmark
gamewrap profile import benchmark
gamewrap profile migrate old-benchmark
gamewrap profile set benchmark mangohud on
gamewrap profile reset benchmark mangohud
gamewrap profile env set benchmark DXVK_ASYNC 1
gamewrap profile env list benchmark
gamewrap profile env unset benchmark DXVK_ASYNC
gamewrap game bind "eldenring.exe" benchmark
gamewrap game unbind "eldenring.exe"
gamewrap game rename "eldenring.exe" "Elden Ring"
gamewrap game note "eldenring.exe" needs game-libs gamemode
gamewrap game clear-note "eldenring.exe"
Friendly Settings
mangohud: turns MangoHud on or offgamemode: turns GameMode on or offsteam-host-libs: prefers host libraries inside Steam runtime environments and setsSTEAM_RUNTIME_PREFER_HOST_LIBRARIES=1game-libs: controls whethergamewrapinjects auto-detected host library directories intoLD_LIBRARY_PATHverbose: shows more detail in diagnostic commandslog-file,log-path: append gamewrap launch decisions to the default state log or a custom pathgamescope: wraps the game in the gamescope Wayland compositorgamescope-width,gamescope-height: set output resolution with a pixel count ornative; unset uses gamescope's 1280x720 defaultgamescope-mode: selectswindowed,borderless, orfullscreengamescope-fps: passes the-rtarget refresh value when gamescope is onfps-cap: caps frame rate through MangoHud whenmangohudis on, for examplegamewrap config set fps-cap 60mangohud-log,mangohud-log-path: enable full-session MangoHud performance logging and optionally choose its output pathvkbasalt: enables vkBasalt post-processing withENABLE_VKBASALT=1vkbasalt-log-level: setsVKBASALT_LOG_LEVELtodebug,info,warning,error, ornonewhen vkBasalt is onesync: forces Proton esync on or off withPROTON_NO_ESYNC; leave unset to use Steam/Proton defaultsfsync: forces Proton fsync on or off withPROTON_NO_FSYNC; leave unset to use Steam/Proton defaultslarge-address-aware/laa: setsPROTON_LARGE_ADDRESS_AWARE=1for older 32-bit Proton games that need more than 2 GB of address spacepre-launch: runs a shell command throughsh -cimmediately before the game launchespost-launch: runs a shell command after the game exits; when set, gamewrap spawns the game and waits for it to finish before running this hookenv-vars: per-profile environment overrides managed withgamewrap profile env set/list/unset/clear
hook-errors (warn | fail, default: warn)
Controls what happens when a pre-launch hook exits nonzero or cannot be executed.
warn— a message is printed to stderr and the game launches anyway.fail— gamewrap aborts with an error and the game is not launched.
The post-launch hook always runs after the pre-launch hook succeeds, even if the game itself fails to start.
Example: gamewrap config set hook-errors fail
How It Works
When gamewrap launches a game, it applies global defaults, then any matching profile overrides, prepares the needed environment variables, and prefixes the game command with gamescope, mangohud, and/or gamemoderun when those features are enabled.
If something important is missing, gamewrap is designed to fail clearly instead of silently skipping the requested behavior. The doctor and status commands help you verify that before launching through Steam.
For terminal usage, gamewrap distinguishes between management commands and explicit launches:
- use commands like
gamewrap game list,gamewrap profile list, orgamewrap game bind ...for management gamewrap game list <text>filters observed games by executable or path substringgamewrap lastshows the most recently observed launchgamewrap game rename <text> <name>gives an observed game a friendlier display namegamewrap game forget <text>removes an observed game from local stategamewrap config editopens the config file in$VISUAL,$EDITOR, ornano- use
gamewrap config exportandgamewrap config import ...for full-config backup and sharing - use
gamewrap profile exportandgamewrap profile import ...for sharing one profile - use
gamewrap profile env set <profile> <KEY> <VALUE>for per-profile environment overrides - use
gamewrap notify testto verify graphical failure notifications - use
gamewrap run <command>when you want to explicitly launch from the terminal - use
gamewrap dry-run <command>when you want to inspect the resolved launch without running it - add
--only when the command or its arguments would otherwise look like gamewrap options
Shell Completion
Recommended:
gamewrap completion install zsh
Then open a new shell.
Other useful commands:
gamewrap completion zsh
gamewrap completion path zsh
The installed completion script is live rather than static. That means:
- new profiles appear in completion results automatically
- newly observed games appear automatically
- you generally only need to reinstall if your shell startup setup changes
Sharing Files
Suggested file names:
shared.gamewrap.toml
benchmark.gamewrap-profile.toml
You do not need to type the full extension yourself. These commands are equivalent:
gamewrap config export shared
gamewrap config import shared
gamewrap profile export benchmark benchmark
gamewrap profile import benchmark
gamewrap automatically adds .gamewrap.toml or .gamewrap-profile.toml when needed.
gamewrap config export writes the sparse global defaults and profile overrides exactly as configured.
gamewrap profile export writes only explicitly configured profile settings. Imported profiles use the receiving machine's global defaults for every unset value.
Files
- Config:
~/.config/gamewrap/config.toml - State:
~/.local/state/gamewrap/state.toml