-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Non-Steam Game: Refactor Shortcut Entry Creation #965
Conversation
Fixed a mistake that wrote out the binary values as strings. Instead of writing out This has since been fixed, and the values look correct when inspecting the bytes. During this, I discovered that |
Tested this a lot tonight and it seems to work fine. Need to test it against a Steam generated After that this should be ready to merge with a shellcheck and a version bump. Will probably do that after work tomorrow, them take a look at fixing up some of the more recent Non-Steam property changes (tags, hidden, openvr) since they're broken at the moment. But this cleanup should be one step towards a cleaner codebase overall :-) Hoping to make more of these PRs as I go and put a focus on cleanup once the Non-Steam game stuff is fixed. Housekeeping has not been enough of a priority and I have really only done it with features I develop (i.e. gamescope). Though some parts could still use a cleanup (ReShade+SpecialK). Gotta get the script under 1mb again at the very least! |
Testing against a Steam generated shortcuts.vdf works (added a Non-Steam Game through the Steam Client, then closed the client and added a game through SteamTinkerLaunch). |
Generating a new |
Shellcheck is green and version is bumped, this is ready to merge! |
Refactors how we generate shortcut entries to write out to
shortcuts.vdf
. This PR is in part motivated to simplify the codebase as well as reduce overall script size.Instead of having a lot of if/else checks for whether to use
\0x01
or\0x00
, we instead just printf regardless and if the value is blank, default to0
. Then, to ensure the value is blank if it isn't 1 or 0 (since we can pass values on the commandline like--hide="no please"
, anything that is passed to one of the following tags will be defaulted to blank, and so set as0
in theshortcuts.vdf
:--hide
--allowdesktopconf
--allowoverlay
--openvr
I had originally wanted to change the usage to simply be
--hide
, and if the flag was present at all, setNOSTHIDE=1
. But with how we use this function inaddNonSteamGameGUI
, that was going to require a lot of if/else checks, or some messy workarounds in that function when we calladdNonSteamGame
, so I didn't bother. In future if someone can figure out a clean way to do this, a PR would be weelcome!