-
Notifications
You must be signed in to change notification settings - Fork 213
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 config file support #1344
base: master
Are you sure you want to change the base?
Add config file support #1344
Conversation
Load config files from /etc/gamescope.d/*.conf in json format. This currently allows the user to specify the allowed refresh rates for different displays.
8ca8583
to
f6f0095
Compare
for (const auto& iter : std::filesystem::directory_iterator(config_dir)) | ||
{ | ||
const auto& path = iter.path(); | ||
if (std::filesystem::is_regular_file(iter.status()) && path.extension() == ".conf") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm on the fence about using a .conf
extensions here. Since the contents are json that makes me want to lean towards the extension being .json
instead.
Overall, not a big deal, will go with whatever you or @Joshua-Ashton think is best
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was actually using .json
initially 🙂 but I really don't mind, both options are fine with me.
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add an example_config.json to the install output? Sort of as a config documentation with every field commented out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another option is installing it as config.json.sample
so it would be ignored by default because of the extension (that's how scripts in .git/hooks
work).
One more thing in case it matters: since the code to read the config dir is quite simple I can save a few KBs on the final binary by using standard libc calls instead of |
Using |
Should it be json formatted? also stuff only in /etc makes it difficult for things to ship default configs... maybe something like libeconf would help for being able to do layered in /usr and /etc? |
great to see movement on something like this! couple ideas as an avid gamescope and handheld PC user that I think might make sense to add as options:
both of these would go a long way towards improving the end user experience on handheld PCs and make it easier to ship upstream gamescope to a wider variety of devices. and perhaps as a future suggestion - expanding this to support specifying a default audio output device for gamescope-session would be sweet. I've noticed that using the Valve provided gamescope-session can sometimes lead to the default output getting changed during session-switches to something like the internal speakers, rather than a preferred external audio playback device. accounting for that in here would give users a way to do this without messing directly with pipewire, which I think many casual linux users are unfamiliar with. |
Those are good suggestions, but both of those requests are features related to steam (not gamescope). |
Hmm that's fair, the only vector to do this before now has been via gamescope patching which is why I put them here. I'll file them in feature requests in steam-for-linux if they don't exist |
This has been superseded by #1527, right? |
Load config files from
/etc/gamescope.d/*.conf
in json format.This currently allows the user to specify the allowed refresh rates for different displays.
Here's the first draft, feedback is welcome.
cc @lostgoat