Skip to content

Configuration and CLI

buntatoes edited this page Nov 28, 2026 · 1 revision

Configuration and CLI

RubyLock RPC stores all user settings in a human-readable config.toml file, automatically created on first launch and migrated seamlessly across config schema updates.

Data Directory Resolution

RubylockRpc::RpcLogger.resolve_data_dir determines where both config.toml and logs/rubylock-rpc.log live:

  1. Writable Application Directory (Portable / User Install): If the directory containing RubyLock RPC (the parent of lib/) is writable — which is true for %LOCALAPPDATA%\RubyLock-RPC, $HOME/.local/share/rubylock-rpc, and local Git checkouts — config.toml and logs/ are stored right next to the application.
  2. Read-Only Install Fallback:
    • Windows: %LOCALAPPDATA%\RubyLock-RPC (or %USERPROFILE%\AppData\Local\RubyLock-RPC).
    • Linux: $XDG_CONFIG_HOME/rubylock-rpc (or $HOME/.config/rubylock-rpc).
  3. Last Resort: Current working directory (Dir.pwd).

Tip

Click the RubyLock RPC system tray icon and choose Open Config Folder to open the active data directory directly in Windows Explorer (explorer.exe) or your Linux file manager (xdg-open).


Complete config.toml Reference

Generate or reset a clean default configuration file at any time with:

rubylock-rpc --generate-config

Below is the full default config.toml (config_version = 6):

[general]
launch_game_on_start = true
exit_when_game_closes = true
# Install available updates automatically instead of showing the update prompt.
auto_update = false
game_log_poll_interval_ms = 500
discord_update_interval_s = 5
# Optional Discord Application ID override (leave empty to use the built-in public Deadlock app ID).
discord_app_id = ""
# Override the Deadlock install location if auto-detection fails. Filled in automatically once
# the game is found, and re-detected if the folder ever stops being a Deadlock install.
# Example: steamapps\common\Deadlock
game_folder = ""
# Set to true after the user declines the shortcut install prompt. Managed automatically.
declined_shortcut = false
# Managed automatically — do not edit.
config_version = 6

[presence]
show_hero_image = true
# Show how long the current match has been running, as a clock (e.g. "07:42"). Added to the
# in-match status line, or placed with {timer} if presence.status.in_match uses that variable.
show_match_timer = true
# Show a Statlocker button when your Steam ID is detected in the game log.
show_statlocker_button = false
# Hero portrait style to display. Options: "normal", "gloat", "critical", "icon", "fullbody".
hero_portrait_style = "normal"
# Rich presence detail line when a hero is selected. Supports {hero}.
details_with_hero = "Playing as {hero}"

[presence.status]
# Status strings for each game phase. Supports {mode} where noted.
game_not_running = "Not Running"
in_main_menu = "Browsing the Main Menu"
in_hideout = "In the Hideout"
in_matchmaking = "Searching for a Match..."
# Supports {mode} (e.g. "Ranked", "Unranked").
loading_into_match = "{mode} - Loading into Match"
# Supports {mode} and {timer} (match duration, e.g. "07:42").
in_match = "{mode}"
match_location_label = "the Cursed Apple"
post_match = "Reviewing Match Results"
spectating = "Spectating a Match"

# Direct HTTPS image URLs or Discord Art Asset keys. Leave corner_image empty ("") to hide the corner badge.
[images]
fallback_large_image = "https://raw.githubusercontent.com/buntatoes/rubylock-rpc/main/assets/icon.png"
fallback_large_image_tooltip = "RubyLock RPC"
corner_image = "https://raw.githubusercontent.com/buntatoes/rubylock-rpc/main/assets/icon.png"
corner_image_tooltip = "RubyLock RPC"

[general] Options

Key Type Default Description
launch_game_on_start bool true Automatically launch Deadlock via Steam with -condebug when RubyLock RPC starts (overridden by --no-launch or --launch-with-command).
exit_when_game_closes bool true Exit RubyLock RPC cleanly once Deadlock closes. When false, RubyLock RPC clears Discord activity and stays in the tray waiting for the next launch. Toggleable live from the system tray.
auto_update bool false When true, automatically downloads and installs newer GitHub Releases without prompting. When false, shows a confirmation dialog if an update is found. Toggleable live from the system tray.
game_log_poll_interval_ms int 500 Polling interval (in milliseconds) for checking console.log growth. Clamped to a minimum of 50 ms (0.05 s) internally.
discord_update_interval_s int 5 Main RPC loop interval (in seconds). Clamped to a minimum of 1 s; match timer display updates use max(discord_update_interval_s, 5) seconds (MIN_TIMER_REFRESH_SECS = 5).
discord_app_id string "" Optional custom Discord Application ID. Leave empty to use the built-in public application ID (1566683259763429509).
game_folder string "" Path to the Deadlock install root (the directory containing game/citadel). Auto-filled when Steam detection succeeds, and re-detected if the folder becomes invalid.
declined_shortcut bool false Internal flag managed automatically.
config_version int 6 Schema version managed automatically by ConfigManager.migrate!.

[presence] Options

Key Type Default Description
show_hero_image bool true Display the active hero portrait as the large Discord Rich Presence image during Hideout, Queue, Match Intro, and In Match phases.
show_match_timer bool true Display elapsed match time formatted as MM:SS (or H:MM:SS once >= 1 hour). Appended as - <timer> unless {timer} is explicitly placed in presence.status.in_match.
show_statlocker_button bool false Opt-in button ("View on Statlocker") linking to https://statlocker.gg/profile/<account_id>/matches once your Steam3 account ID ([U:1:<id>]) is seen in console.log.
hero_portrait_style string "normal" Portrait art variant fetched from Deadlock API. Valid values: "normal", "gloat", "critical", "icon", "fullbody" (unrecognized values fall back to "normal").
details_with_hero string "Playing as {hero}" Top detail line used during IN_MATCH when a hero name is resolved. Supports {hero}.

[presence.status] Options & Template Variables

Key Default Supported Variables Notes
game_not_running "Not Running" — Shown before Deadlock is detected or after exit (before clear/shutdown).
in_main_menu "Browsing the Main Menu" — Shown when Deadlock is running before entering the Hideout.
in_hideout "In the Hideout" {hero} Fallback if the hero has no hideout_rich_presence flavor text from the Deadlock API.
in_matchmaking "Searching for a Match..." — Shown as the second line (state) while details displays the Hideout line.
loading_into_match "{mode} - Loading into Match" {mode} When mode is not yet inferred, leading/trailing dashes and whitespace are trimmed cleanly ("Loading into Match").
in_match "{mode}" {mode}, {location}, {timer} Template applied for Standard Match, Ranked Match, Street Brawl, and In Match. For Bot Match, Training Range, and Hero Labs, the mode display name is used directly (with - <timer> appended if timer is enabled).
match_location_label "the Cursed Apple" — Value substituted for {location} in in_match.
post_match "Reviewing Match Results" — Shown after lobby destruction or returning to menu from a match.
spectating "Spectating a Match" — Shown while watching a broadcast (Playing Broadcast).

[images] Options

Key Default Description
fallback_large_image https://raw.githubusercontent.com/buntatoes/rubylock-rpc/main/assets/icon.png HTTPS URL or Discord Art Asset key shown when no hero portrait is active (e.g., Main Menu, Post Match, Spectating, or offline hero lookup).
fallback_large_image_tooltip "RubyLock RPC" Hover tooltip for the fallback large image.
corner_image https://raw.githubusercontent.com/buntatoes/rubylock-rpc/main/assets/icon.png Small corner badge HTTPS URL or Discord Art Asset key. Set to "" to hide the corner badge. Automatically suppressed when identical to large_image so the same icon is not duplicated.
corner_image_tooltip "RubyLock RPC" Hover tooltip for the corner badge.

Automatic Config Migration

When loading an existing config.toml, ConfigManager.migrate! inspects general.config_version:

  • If config_version < 6, missing keys from DEFAULT_TOML are merged without overwriting user-customized values.
  • Legacy "deadlock_logo" asset keys in [images] are migrated to DEFAULT_ICON_URL, and legacy "Deadlock RPC" tooltips are updated to "RubyLock RPC".
  • config_version is bumped to 6 and written back to disk.
  • If config.toml cannot be read or parsed, RubyLock RPC logs a warning and continues running with safe defaults.

CLI Flags Reference

Usage: rubylock-rpc [OPTIONS] [-- <game command>]
Flag Description
--no-launch Skip launching Deadlock on startup, even if launch_game_on_start = true in config.toml.
--no-tray Run headless without initializing the Windows or Linux system tray icon (Tray::NullTray).
--no-update-check Skip the background GitHub Releases update check on startup.
--check-update Query GitHub Releases for a newer version, print the result, and exit with status 0.
--update Download and install the latest GitHub release immediately, then exit (0 on success, 1 on failure).
--uninstall Launch the platform uninstaller (RubyLock-RPC-Setup.exe --uninstall on Windows, uninstall.sh on Linux).
--silent Combine with --update or --uninstall to run non-interactively without GUI confirmation prompts.
--no-shortcut Accepted CLI option to skip shortcut prompt handling.
--launch-with-command -- <cmd> Launch <cmd> with -condebug automatically appended (designed for Steam Launch Options -- %command%). Exits with status 1 if no command follows --.
--generate-config Write a fresh default config.toml to the resolved data directory and exit.
-v, --version Print rubylock-rpc v1.3.0 and exit.
-h, --help Print CLI usage help and exit.

Single-Instance Locking

RubyLock RPC enforces a single active daemon by binding a loopback TCP listener on localhost, port 47782 (SINGLE_INSTANCE_PORT = 47_782).

If you launch rubylock-rpc while an instance is already running:

  • With --launch-with-command -- <cmd>: spawns the game command with -condebug, waits for it to exit (Process.wait), and returns 0 while the primary instance continues managing Rich Presence.
  • Without --no-launch: re-triggers Launcher.launch_deadlock (useful if you double-click the Desktop shortcut again) and exits cleanly.
  • With --no-launch: logs that another instance is already running and exits with 0.