Skip to content

Releases: doccy-doc/egswitcher

1.0.0

16 Apr 07:34
59ca67b

Choose a tag to compare

v1.0.0 - The Stable Release

EGSwitcher v1.0.0 marks the first feature complete, production-ready release. This version represents a complete architectural overhaul focused on state safety, strict XDG compliance, and a heavily refined user experience.

🌟 Highlights

  • Context-Aware Session Handling: EGSwitcher now intelligently detects if you are logged into an unrecognised account. Instead of failing or overwriting your data, it offers to securely claim the current session.
  • Smart Command Routing: Commands now understand context. If you try to save an unrecognised account, EGSwitcher routes you through the new account flow to safely register it.
  • True Portability: egs is now a completely self-healing, single-file executable. Drop it anywhere on any machine, and it will automatically bootstrap its entire XDG directory structure on first run.

✨ New Features

  • egs unload: Added a dedicated command to safely wipe the active launcher state and registry keys without needing to swap to a different account. Perfect for testing or fully logging out.
  • Interactive Config Wizard: Missing values (like changing your Wine prefix) now trigger a validated input loop instead of throwing errors or forcing you to manually edit text files.
  • Environment Variable Overrides: Added support for EGSPFX and EGSDEBUG envars for single-run overrides without touching persistent config files.

🔄 Changes

Executable Rename: Binary renamed from epic-switcher to egs for faster CLI interaction.

  • File Schema Updates:
    • accounts.txt renamed to accounts.state to deter user editing.
    • config.txt moved to $XDG_CONFIG_HOME/egswitcher/EGSwitcher.conf.
    • Fully separated data, cache, and config directories according to the XDG Base Directory Specification.

🛡️ Under the Hood (Architecture)

  • Defensive Validation: Strictly separated pure check functions from fatal state checks to prevent logic loops and ensure predictable behaviour.
  • Lazy Dependency Loading: Moved dependency checks out of the global scope. --help, --version, and list now work if dependencies are missing.
  • Atomic State Management: Account switching now uses isolated temporary files in $XDG_CACHE_HOME with a strict EXIT trap to guarantee cleanup.
  • Stateless Database: The underlying accounts.state file no longer requires an active account (*) to function safely.

🐛 Bug Fixes

  • Fixed a critical recursion bug where cmd_new calling cmd_save could inadvertently trigger a recursion loop.
  • Fixed init_egs_env failing to apply WINEPREFIX environment variables when recovering from an invalid prefix path.
  • Fixed validate_prefix mutating global state, which caused config file overwrite when using an invalid override EGSPFX path.

0.3.0 (RC1) - Config Update

09 Apr 02:30
f9407e0

Choose a tag to compare

🚀 Release 0.3.0 - Config Update (1.0.0 Release Candidate)

This release marks the most significant evolution to date. We have moved away from the "hardcoded script" model toward a professional, portable Linux utility that follows modern standards and priorities data integrity. If no changes are needed, this will become the base for the 1.0.0 stable release.

🛠️ Dynamic Configuration System

The biggest change in 0.3.0 is the removal of all hardcoded environment variables.

  • CLI Management: Use the new config command to update your Wine prefix or toggle debug mode without ever touching the source code.
  • Persistent Storage: Settings are now saved to a dedicated configuration file, making the tool portable across different Linux setups.

🐧 XDG Base Directory Compliance

Following the standard Linux filesystem hierarchy, epic-switcher now neatly categorises its files to keep your $HOME clean:

  • Config: ~/.config/egswitcher/egswitcher.conf
  • Data: ~/.local/share/egswitcher/accounts.state
  • Cache: ~/.cache/egswitcher/ (Auto-cleaned via EXIT traps)

🛡️ Hardened Security & Execution Guards

To prevent the common "sudo trap" that ruins file permissions in WINE prefixes, we’ve added strict execution checks:

  • Root Block: The script will refuse to run as root or via sudo.
  • User Match: Ensures the executing user matches the owner of the environment to prevent permission corruption.
  • File Security: The account database is now provisioned with 600 permissions (Owner Read/Write only) to protect your launcher identifiers.

🧪 Path Handling

We implemented a specialised path encoding engine designed to survive the "backslash hell" of Linux/WINE paths in CLI.

  • Injection-Proof: Safely handles paths containing spaces, quotes, ampersands, dollar signs, and all known injection vectors.
  • Variable Storage: Config values are stored as single-quote literals to prevent unintended shell expansion when the config is sourced.
  • Cleanup: Integrated EXIT traps to ensure all temporary files and named pipes are purged, regardless of how the script ends.

Note: The trade-off of this is you cannot use shell shortcuts like ~/path or global variable like $HOME/path for config values.

⚠️ Breaking Changes

  • File Locations: If you are upgrading from 0.2.3 or lower, your old accounts.txt data must be moved to the new XDG path: ~/.local/share/egswitcher/accounts.state.

  • Variable Names: Internal config variables have been standardised to the EGS_ (e.g. EGS_PFX) prefix for better environment clarity. Single-run config overrides are standardised to have no _ (e.g. EGSPFX). This made dynamic implementation of single-run overrides for all config variables much simpler.

Developer's Note: This refactor was a deep dive into the darker corners of sed and bash quoting. The result is a utility that should be indestructible regardless of how complex your Wine prefix pathing is. Enjoy the stability!

Note

Upcoming Breaking Change: CLI Renaming in 1.0.0
Please be advised that starting with the 1.0.0 stable release, the executable will be renamed from epic-switcher to egs for brevity and to reflect the evolution of this project from a simple bash script to a CLI tool.

  • What to expect: In 1.0.0, the epic-switcher naming will be removed entirely (hard cut-off).
  • Internal API: All flags, commands, and arguments will remain identical; only the filename of the tool is changing.
  • Action: We recommend reviewing your CI/CD pipelines, shell scripts, and aliases now to ensure a smooth transition when 1.0.0 is released. If you wish to revert to using the old name, you can use mv ./egs ./epic-switcher or alias the new filename.

0.2.1 - Performance Update

30 Mar 06:56
fce4fc9

Choose a tag to compare

This release focuses on making EGSwitcher significantly more performant and dynamic.

🛠️ Technical Improvements:

  • Registry-Aware Discovery: The script now queries the WINE Registry (HKCU\Volatile Environment) to find and map %LOCALAPPDATA% dynamically.
  • Stateful Initialisation: Implemented a initialisation function and state guard. This ensures that WINE-heavy operations (Registry queries, path translations, etc) only run once per process, even during nested function calls. This improves performance dramatically.
  • API compatible with all prior releases.

UX feedback is encouraged.

Note

The prefix configuration method will likely change in 0.3.0.

0.2.0 - Debug Update

24 Mar 07:21

Choose a tag to compare

  • Implemented Diagnostic System: Integrated verbose logging for real-time troubleshooting.
    • Usage: Set the EGS_DEBUG environment variable to 1 for debug level output.
      e.g. EGS_DEBUG=1 epic-switcher [command] or export EGS_DEBUG=1
  • Fixed User Detection: Resolved a parsing issue with wine whoami that was forcing a heuristic fallback on every run.
  • Refined Output: Improved CLI feedback and silenced redundant initialisation messages.
  • API compatible with all prior releases.

UX feedback is encouraged.

Note

The prefix configuration method will likely change in 0.3.0.

0.1.2

16 Feb 05:51

Choose a tag to compare

Bugfix: Fixes 0.1.1 regression -- cmd_new now correctly deactivates the previous account.
No API or functional changes.

UX feedback is encouraged.

Note

The prefix configuration method will likely change in 0.3.0.

0.1.1

15 Feb 15:23

Choose a tag to compare

Minor housekeeping update.

Refactored internal logic and improved overall code readability.
No API or functional changes.

UX feedback is encouraged.

Note

The prefix configuration method will likely change in 0.3.0.

0.1.0

12 Feb 11:26

Choose a tag to compare

This is the initial functional release. I am looking for UX feedback from users.

Note

The prefix configuration method will likely change in 0.3.0.