Skip to main content

Switch between saved Steam accounts on Linux.

Project description

steam-acc-switcher

A small CLI for switching between your saved Steam accounts on Linux.

It works the way Steam actually works on Linux: it edits the two plain-text VDF files Steam reads at startup to decide who to auto-login as. It doesn't touch passwords or 2FA.

Why

Because I have too many Steam accounts for playing Yugioh and Steam's own account picker only shows 5 accounts.

How it works

Steam picks its auto-login account from two files:

  1. <steam_root>/config/loginusers.vdf, which has one block per account keyed by SteamID64. The active account is the one with MostRecent set to "1".
  2. ~/.steam/registry.vdf, the Linux stand-in for the Windows registry. AutoLoginUser (an AccountName) under Registry/HKCU/Software/Valve/Steam is what Steam logs into.

A switch does four things: locate the files, cleanly shut Steam down, edit both files, then relaunch Steam.

Steam must be fully closed before writing, because it rewrites loginusers.vdf on exit and would clobber the change. The tool sends a clean steam -shutdown (not a kill), waits for the process to disappear, and aborts rather than risk corruption if Steam won't quit. Each file is backed up (.bak) and written atomically before being replaced.

It auto-detects native, Flatpak, and Snap installs.

Prerequisite (one-time, per account)

You need to have logged into each account at least once with "Remember password" checked. That's what creates the saved-credential token (ssfn*) files this tool relies on. The switcher only flips which saved account is active. It never stores or types passwords or 2FA codes.

Install

Requires Python 3.10+.

The easiest way is to install it as an isolated CLI tool, which puts sas and steam-acc-switcher on your PATH:

# with uv (https://docs.astral.sh/uv/)
uv tool install steam-acc-switcher

# or with pipx
pipx install steam-acc-switcher

To install with plain pip instead:

pip install steam-acc-switcher

Or from a local checkout of this repo:

pip install .

Usage

# Run with no arguments for the interactive picker. Your saved accounts are
# listed (active one starred), use ↑/↓ to move, Enter to switch, q to cancel.
sas

# Enrich the menu with online state / VAC status (public profile lookup).
sas --online

# Switch directly by AccountName or nickname (case-insensitive), skipping the menu.
sas alice

# Skip confirmation prompts.
sas alice --yes

In the interactive picker, press r to give the highlighted account a nickname (blank to clear). Nicknames show up in the menu and can be used as switch targets, e.g. sas Main.

sas and steam-acc-switcher are equivalent. You can also run it without installing via python -m sas.

Note: switching closes and reopens Steam, so save your game and exit any running game first.

Notes

  • VDF key casing varies between Steam versions (mostrecent vs MostRecent); keys are read and written case-insensitively, preserving existing casing.
  • The --online enrichment uses Steam's public https://steamcommunity.com/profiles/<id>?xml=1 endpoint, needs no auth, and fails gracefully when offline.
  • Account state lives in Steam's own VDF files; the tool never touches credentials. The only thing it stores of its own is the optional nickname map, keyed by SteamID64, at ~/.config/sas/nicknames.json (honoring XDG_CONFIG_HOME).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

steam_acc_switcher-0.1.0.tar.gz (34.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

steam_acc_switcher-0.1.0-py3-none-any.whl (26.0 kB view details)

Uploaded Python 3

File details

Details for the file steam_acc_switcher-0.1.0.tar.gz.

File metadata

  • Download URL: steam_acc_switcher-0.1.0.tar.gz
  • Upload date:
  • Size: 34.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for steam_acc_switcher-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d05c6ff8335ec1258c25acc054dfe1ce9b1686b151029ef6b97084eb42c764c2
MD5 f6bf431298422863761206dec29ac4a6
BLAKE2b-256 166424ccdfeb8da548b827d2128aca7a9949fbe3a369b5dfe5c460fb1bf7c532

See more details on using hashes here.

File details

Details for the file steam_acc_switcher-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: steam_acc_switcher-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 26.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for steam_acc_switcher-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0a3173291cef2568d57deded823961956759433b90f58469a42257babd57e1c3
MD5 ba3a1f164fac3896cc5f69fbb77a002b
BLAKE2b-256 504291ed46cc425c08a8873725ca6df3f967695f23aaf97c71848be10c4f711c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page