Releases: doccy-doc/egswitcher
1.0.0
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:
egsis 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
EGSPFXandEGSDEBUGenvars 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.txtrenamed toaccounts.stateto deter user editing.config.txtmoved 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, andlistnow work if dependencies are missing. - Atomic State Management: Account switching now uses isolated temporary files in
$XDG_CACHE_HOMEwith a strictEXITtrap to guarantee cleanup. - Stateless Database: The underlying
accounts.statefile no longer requires an active account (*) to function safely.
🐛 Bug Fixes
- Fixed a critical recursion bug where
cmd_newcallingcmd_savecould inadvertently trigger a recursion loop. - Fixed
init_egs_envfailing to applyWINEPREFIXenvironment variables when recovering from an invalid prefix path. - Fixed
validate_prefixmutating global state, which caused config file overwrite when using an invalid overrideEGSPFXpath.
0.3.0 (RC1) - Config Update
🚀 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
configcommand 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
rootor viasudo. - 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
600permissions (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
EXITtraps 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
~/pathor global variable like$HOME/pathfor config values.
⚠️ Breaking Changes
-
File Locations: If you are upgrading from
0.2.3or lower, your oldaccounts.txtdata 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
sedandbashquoting. 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, theepic-switchernaming 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.0is released. If you wish to revert to using the old name, you can usemv ./egs ./epic-switcheror alias the new filename.
0.2.1 - Performance Update
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
- Implemented Diagnostic System: Integrated verbose logging for real-time troubleshooting.
- Usage: Set the
EGS_DEBUGenvironment variable to1for debug level output.
e.g.EGS_DEBUG=1 epic-switcher [command]orexport EGS_DEBUG=1
- Usage: Set the
- Fixed User Detection: Resolved a parsing issue with
wine whoamithat 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.