Open vchernin opened 2 years ago
Started test build 68162
Build 68162 successful To test this build, install it from the testing repository:
flatpak install --user https://dl.flathub.org/build-repo/65995/com.mojang.Minecraft.flatpakref
Started test build 68172
Build 68172 successful To test this build, install it from the testing repository:
flatpak install --user https://dl.flathub.org/build-repo/66005/com.mojang.Minecraft.flatpakref
Thanks! I will test it when I have more time, however I am not sure whether I like adding a new wrapper script just for Gamescope.
In theory a wrapper script could also be necessary for mods, optifine etc, but I haven't tried that yet.
I agree it's not ideal, I'm sure there's some trick I could use to avoid the wrapper, I just haven't found it. Gotta keep working on my scripting skills :)
You could probably include it as a function directly in the main script file, then call the function. ;-)
Running from a function works fine, I discovered that early on. The problem is passing --workDir
doesn't work without a new file.
The commited version with the wrapper script is able to correctly launch gamescope with minecraft with all correct arguments (at least as far as I can tell).
To only use one file, you can replace the last exec
line with one of the following demos:
Works (but no --workDir
)
minecraft_wrapper () {
exec /app/utils/gamescope/bin/gamescope "/app/extra/minecraft-launcher/minecraft-launcher"
}
# verify extension installed and config file exists.
if test -f "/app/utils/gamescope/bin/gamescope" && test -f "$XDG_DATA_HOME/../.minecraft/gamescope.txt"; then
minecraft_wrapper "--workDir $XDG_DATA_HOME/../.minecraft"
else
/app/extra/minecraft-launcher/minecraft-launcher
fi
Notice how even though I'm passing --workDir
to the function, the function doesn't actually use any parameters, i.e. there is no $1.
But if I tell it to use the --workDir
argument:
minecraft_wrapper () {
exec /app/utils/gamescope/bin/gamescope "/app/extra/minecraft-launcher/minecraft-launcher $1"
}
# verify extension installed and config file exists.
if test -f "/app/utils/gamescope/bin/gamescope" && test -f "$XDG_DATA_HOME/../.minecraft/gamescope.txt"; then
minecraft_wrapper "--workDir $XDG_DATA_HOME/../.minecraft"
else
/app/extra/minecraft-launcher/minecraft-launcher
fi
Now this never works.
Somehow launching gamescope within a function, with a command that happens to have an argument causes xwm to not be found. The same happens with other minecraft launcher arguments. Yet this problem doesn't exist with a new file as commited.
Please remember to update this to use the new gamescope extension, if you (or anyone else) picks up work on it: https://github.com/flathub/com.valvesoftware.Steam.Utility.gamescope
Todo: