You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Made fix-wm-class.sh run as long as game is running. (#50)
* fix-wm-class.sh now runs while reaper process is running
In order to move away from the per game sleep method, I have made it so
that fix-wm-class.sh now runs as long as the reaper wrapper process is
still running. Should work in 99.9% of cases, tested with UNDERTALE and
Pillars.
* Removed commented out code
* fix-wm-class.sh now monitors processes, and stops running once the process is ended. It extracts the last parameter as the Window Class, so the usasge needs to be fix-wm-class.sh %command% "WM_CLASS". Additionally, it works with gamemoderun, from what little testing I did. However, gamemoderun needs to go before everything else:
gamemoderun fix-wm-class.sh %command% "WM_CLASS". Will work on the python script to fix that next.
* Updated sif.py. It now:
Finds all instances of %command% in an existing launch option array, and removes them.
Strips out any excess whitespace and stores the launch options.
Instead of appending to the existing options, the options are now overridden, with any existing options (barring %command%) going before fix-wm-class.sh. This is to facilitate the usage of things like mangohod or gamemoderun.
for instance, say a game's launch options are currently gamemoderun %command%. Upon running sif.py, the new command will be gamemoderun PATH_TO_SIF/fix-wm-class.sh %command% WM_CLASS;
Tested witn UNDERTALE and Pillars of Eternity. I do not know if it will work with WM_CLASS_ALT games, as at the moment fix-wm-class treats the very last argument it receives as WM_CLASS regardless of anything else.
* Removed logging.
* Removed logging, take 2 (I missed one)
* Updated sif.py. WIP on fix-wm-class.sh
I've fixed sif.py to account for the new launch options.
I don't know much about regexes, so it *might* be a bit
hacky, feel free to change it to be more optimal. However,
I am still struggling with fix-wm-class.sh. It turns out,
if you surround %command% with quotes, steam automatically
inserts 'single quotes' around some of the arguments, breaking
the %command%. Double quoting makes it even more nested.
Regardless, fix-wm-class.sh now works with Undertale...
But not with Pillars of Eternity. The game simply never launches.
I suspect the spaces in the folder's name are responsible,
so I tried launching it without removing the single quotes
it generated. That did not change anything. Interestingly,
Steam thinks POE is running without the single quote in args;
otherwise, it instantly closes. Finally, I have to launch with
$@. "$@" causes neither Undertale nor PoE to launch. Need
advice.
* Implemented suggestions on fix-wm-class.sh.
Should work now. One potential issue, any command line arguments after %command% will be stripped away along with everything after fix-wm-class.sh when running SIF. I can also see a scenario where, say a game runs like:
`gamemoderun %command% --some-arg`
SIF, if fix-window-class has never been run before, will likely put
`gamemoderun --some-arg fix-wm-class.sh %command%`
I think this will not work. That said, I don't have enough experience with regexes to fix this, and it's a bit beyond the scope of this change, I think. I believe we should merge this, and handle that behavior in another PR potentially? Alternatively I can try to make it work if pointed in the right direction. For now, I added a message to the users to double check their launch options (which I think they should do anyway):
`print("\n * - added fix to game launch options. Please double check to ensure your launch options are correct.")`
* Changed double check message.
0 commit comments