datah4zard/protontools

Rust library and CLI tool for discovering and invoking Proton installations on Linux systems.

★ 3Forks 0RustGitHub ↗Compare

README

protontools

Rust

A Rust library and CLI tool for discovering and invoking Proton installations on Linux systems.

Demo

Overview

protontools provides utilities for:

  • Locating Proton installations
  • Detecting Steam Deck hardware
  • Launching Windows executables using Proton

Additionally, protontools includes protonrun, a powerful CLI tool for launching Windows executables with the Proton installations on your system.

Installation

CLI Tool (protonrun)

You can build and install the tool without cloning the repo:

cargo install protontools --features protonrun

For dev, clone the repo and build:

cargo build --release --features protonrun

CLI Usage

# List all detected Proton installations
protonrun --list

# Run an executable with the default Proton installation (if set)
protonrun /path/to/game.exe

# Run with a specific Proton version
protonrun --name "Proton 9.0" /path/to/game.exe

# Interactively select a Proton installation and prompt to set as default
protonrun --select /path/to/game.exe

# Specify a custom prefix path
protonrun --prefix /path/to/prefix /path/to/game.exe

Library

cargo add protontools

IMPORTANT: The API surface of the library is empty if you are not compiling your crate for Linux.

Options

Option Description
-l, --list List all detected Proton installations
-n, --name <NAME> Use a specific Proton installation by name
-s, --select Interactively select a Proton installation
-p, --prefix <PATH> Custom prefix path (default: .proton next to executable)

Library Usage

use protontools::{find_all_proton_installs, generate_launch_command};
use std::path::Path;

// Enumerate all Proton installations
let installs = find_all_proton_installs();
for install in &installs {
    println!("{}: {}", install.get_name(), install.get_installation_path().display());
}

// Launch an executable with the last modified Proton install
if let Some(proton) = installs.into_iter().next() {
    let exe = Path::new("/path/to/game.exe");
    let mut cmd = generate_launch_command(&proton, exe, None).unwrap();
    cmd.status().unwrap();
}

Limitations

  • Steam must be installed in the default directory at ~/.steam/

Contributors

datah4zard

Issues