Skip to content

Instantly share code, notes, and snippets.

@notquite28
Created March 7, 2026 20:29
Show Gist options
  • Select an option

  • Save notquite28/67a54405c6f9a0bfbad1c8b4b4c4f97f to your computer and use it in GitHub Desktop.

Select an option

Save notquite28/67a54405c6f9a0bfbad1c8b4b4c4f97f to your computer and use it in GitHub Desktop.
protontricks script to start trainer in game prefix
#!/bin/bash
# 1. Read games safely into array (each line = one element)
mapfile -t GAMES < <(protontricks -l | grep -E '\([0-9]+\)')
# 2. Show list
CHOICE=$(zenity --list \
--title="Select Steam Game" \
--column="Installed Games" \
--width=600 --height=400 \
"${GAMES[@]}")
# Exit if cancelled
[ -z "$CHOICE" ] && exit 1
# 3. Extract AppID
APPID=$(echo "$CHOICE" | awk -F'[()]' '{print $2}')
# 4. Pick trainer
TRAINER_PATH=$(zenity --file-selection \
--title="Select Trainer .exe" \
--filename="$HOME/Games/" \
--file-filter="*.exe")
[ -z "$TRAINER_PATH" ] && exit 1
# 5. Launch
zenity --info --text="Launching trainer for AppID: $APPID\n\nEnsure the game is running!" --timeout=2
protontricks-launch --no-bwrap --appid "$APPID" "$TRAINER_PATH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment