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.1.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.1-py3-none-any.whl (26.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: steam_acc_switcher-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 58b00677a30a26d6275ec1083c94c785fee71f6b6cfee49d664164eea472d9bb
MD5 e8e1faea06422d834101ba2fde6e7985
BLAKE2b-256 538f9fb4ee56e63a836cbde5a0908c932a06902a943afc2f2b64f447081b4309

See more details on using hashes here.

File details

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

File metadata

  • Download URL: steam_acc_switcher-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ebcb0c9d0b92dd1338bdd1c2c860fee548200444609f046c076fda985371d8cf
MD5 5cfb7899bace055cb6581c35ccf6d031
BLAKE2b-256 c09561bb1ed9f37644a6faf99135e67629ffb5644bbd3226a650bb64bb90d4ba

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