Skip to content

doccy-doc/egswitcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 

Repository files navigation

EGSwitcher

A lightweight, defensive Bash utility for managing multiple Epic Games Launcher accounts on Linux/Wine. Swap accounts instantly without losing your login session or launcher settings.

🔒 Privacy & Security

EGSwitcher does not require, read, or store your Epic Games password, username, or email. It functions entirely by swapping local, ephemeral authentication tokens and configuration files generated by the Epic Launcher. Your credentials are never exposed to this tool.

🚀 Features

  • Portable & Resilient: A single-file executable that bootstraps its entire environment on first-run. Drop it anywhere in any supported environment and it will run. If config or state files are ever deleted, the self-healing bootstrap will regenerate them.
  • Context-Aware Session Detection: Intuitively detects if you are logged into an unrecognised account. It offers to securely "claim" the current session to avoid data loss.
  • Defensive Architecture: Defensively written, strictly validated, and battle-tested for edge cases. Extremely safe for newcomers.
  • Atomic State Management: Uses isolated temporary files to ensure account switching is atomic. If a process is killed halfway through, changes are abandoned.
  • WINE Native Integration: Uses the WINE API for session-safe termination.
  • Smart Directory Detection: Uses WINE registry to accurately find the prefix's correct paths, with heuristic directory scanning as a fallback for unconventional setups.
  • Interactive Configuration Wizard: Users can choose to edit a config file, or use the Interactive CLI prompts to modify their configuration.
  • Strict XDG Compliance: Properly utilises XDG Base Directory specs for file management. This makes it easy to integrate into existing backup workflows.

⚠️ Caveats & Known Limitations

Session Staleness: The Epic Games Launcher invalidates session tokens after a period of inactivity. Common reports indicate up to 15 days, or up to 30 days with remember me selected. If you load an account that has passed this threshold, the stale session will be successfully swapped by EGSwitcher, and the launcher will likely prompt you to re-authenticate.

To prevent this, you should periodically cycle through all your swapped accounts to keep the session tokens fresh. (A contingency feature for this is planned for 1.1.0).

🛠️ Installation

  1. Download the latest release

  2. Make Executable: chmod +x ./egs

  3. Add to Path (Optional): mv ./egs ~/.local/bin/

  4. Configure Prefix: egs config pfx

  • and enter the full path to your Epic Games Launcher WINE/Proton prefix

📖 Usage

Create a New Account

egs new [name]
  1. egs new my-new-account (or just egs new to be prompted)
  • If an unrecognised session is active, it will prompt you to claim it.
  1. Relaunch the Epic Launcher and log in to your account
  2. Type y into the prompt

Save an Active Account

egs save [name]
  • Run: egs save my-account
  • Or run: egs save
  • If an unrecognised session is active, it will prompt you to claim it.

Switch Accounts

egs load <name>
  1. Run: egs load my-alt-account
  • If an unrecognised session is active, it will prompt you to claim it.
  1. Launch the game

Clear the Launcher

egs unload
  • If an unrecognised session is active, it will prompt you to claim it.

List Saved Accounts

egs list

Rename an Account

egs rename <old> <new>
  • Run: egs rename my-old-name my-new-name

Delete an Account

egs delete <name>
  • Run: egs delete my-crap-account

Change the Active Prefix

egs config pfx [/path/to/prefix]

For persistent change:

  • Run: egs config pfx and follow the prompt
    • Note: Must be an absolute path (e.g. /home/username/.wine). Cannot use ~/ or envars (e.g. $HOME).
  • Or run: egs config pfx "$HOME/.wine/"
    • Note: Can use envars in path (e.g. $HOME/.wine or $WINEPREFIX). Cannot use ~/.
  • Or edit: ~/.config/egswitcher/egswitcher.conf: EGS_PFX='/home/username/.wine/'
    • Note: Must be an absolute path (e.g. /home/username/.wine). Cannot use ~/ or envars (e.g. $HOME).

To change for a single run:

  • Run: EGSPFX="/path/to/prefix" egs [command]
    • Note: Can use envars in path (e.g. $HOME/.wine or $WINEPREFIX). Cannot use ~/.

Show Debug Messages

egs config debug [1|0]

To enable for a single run:

  • Run: EGSDEBUG=1 egs [command]

To enable persistent debugging:

  • Run: egs config debug 1
  • Or edit ~/.config/egswitcher/egswitcher.conf: EGS_DEBUG=1

See a List of Commands

egs -h|--help
  • Run: egs
  • Or run: egs -h
  • Or run: egs --help

📁 File Schema

EGSwitcher follows the XDG Base Directory Specification. All files and directories are created automatically as required. If you wish to backup or inspect your data, they are located here:

  • Account Data: $XDG_DATA_HOME/egswitcher/ (Defaults to ~/.local/share/egswitcher/)
  • Config Files: $XDG_CONFIG_HOME/egswitcher/ (Defaults to ~/.config/egswitcher/)
  • Cache/Temp Files: $XDG_CACHE_HOME/egswitcher/ (Defaults to ~/.cache/egswitcher/)

Tip

If these environment variables are not set on your system, it falls back to the standard hidden directories in your $HOME.

🛡️ Dependencies

  • WINE or Proton
  • rsync
  • coreutils

Copyright © 2025 doccy-doc License: GPL-3.0-only See License

SPDX-License-Identifier: GPL-3.0-only

About

A lightweight Bash utility for managing multiple Epic Games accounts on Linux/Wine. Swap accounts instantly without losing your login session or settings.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages