Repository navigation
feat: no sleep while playing, Flatpak autostart, game tools and known fixes - #32
Merged
Merged
Conversation
Windows holds SetThreadExecutionState on its own thread; Linux holds the desktop portal's Inhibit (idle and suspend) over zbus, which also works in the Flatpak. The poll takes the hold while a game runs and drops it when the game ends; Guild exiting ends it with its thread or bus connection.
The sandbox can't write the host's autostart folder, so the switch was hidden. In a Flatpak it now asks the desktop portal's Background interface (autostart with guild --minimized) and keeps the answer in settings, since the entry it writes is out of reach. Outside the Flatpak nothing changes.
Settings -> Wine gets a switch per tool (off by default) and a game's Launch options a Default / On / Off menu per tool, kept with its other launch options in game_prefs. Windows games wrap umu-run, native Linux builds their own program. A tool that isn't on PATH shows disabled with the reason; the Flatpak finds MangoHud and gamescope in their Flathub Vulkan layer extensions and gamemoderun in the runtime.
The community list's environment variables for a game, matched by the store's own id, are set before it runs through umu. The list is cached in info (kind known-fixes) for a day and refreshed behind a Play once stale; a variable the launch or Guild's own environment already sets wins. Its winetricks verbs and installers are left out.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four launch extras, in one commit each.
Keep the PC awake while a game runs
SetThreadExecutionState(system + display) held on its own thread. Linux: the desktop portal'sInhibit(idle) over zbus, which works in the Flatpak without a talk-name.Start on login in the Flatpak (Background portal)
org.freedesktop.portal.Background.RequestBackgroundwithautostartandguild --minimized, and keeps the answer insettings, because the host's autostart entry is out of reach. If the desktop says no, the switch flips back with a message.Gamescope, MangoHud and GameMode (Linux)
launch_optionsJSON ingame_prefs). The table schema doesn't change, so there's no migration step.gamescope -f [--mangoapp] --,mangohud --dlsym(without gamescope),gamemoderun, then umu-run (Windows games) or the game's own program (native GOG builds).xdg-run/gamescope-0andxdg-config/MangoHud:ro.gamemoderuncomes from the runtime.Heroic known fixes
known_fixes.jsonis cached ininfo(kindknown-fixes) for a day. A stale list is used and refreshed in the background. A Play with no cached list at all fetches it first (5 s at most). Failures only log.epic/gog/amazon→ app name / product id), never by title. OnlyenvVariablesare applied (today 8 Epic games, allUSE_FAKE_EPIC_EXE). A variable the launch already sets, or that Guild was started with, wins. Winetricks verbs andrunInPrefixinstallers are left out: they mean long downloads during a Play, and umu's protonfixes already cover many of those games.Tested
cargo fmt --check,cargo clippy --all-targets -D warnings,cargo test,npm run check,npm testandnpx prettier --check ..🤖 Generated with Claude Code