Add config file support
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
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 std::filesystem at the expense of slightly more verbose code.
Using std::filesystem should be fine. I don't think a few KBs are worth rolling our own.
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:
-
adding an easy way to scale the Steam UI for internal panels - perhaps in a simple flag like
ui-scale-factor=2.00? this would be huge for handheld devices with higher resolution displays than the Steam Deck - such as the ROG Ally which is 1920x1080p or the even more egregious Legion Go which is 2560x1600p. as far as i'm aware, the only option to do this right now is either 1: make gamescope think your panel is external with a forked version of gamescope or 2: rely on third-party extensions to access "hidden" dev options that end users should definitely not be messing with -
adding in a way for users to define the default resolution that gamescope should use for games in an embedded context like gamescope-session, offering an easy way to bypass the 720p restriction within steam without having to go into every game entry and change Default -> Native (or whatever other resolution you'd prefer). this is probably a better option something like always defaulting to a monitor's native resolution in case people hook up 4K monitors or TVs to a Steam Deck so they're not left with 5fps in games unexpectedly.
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.
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:
1. adding an easy way to scale the Steam UI for internal panels - perhaps in a simple flag like `scale-factor=2.00`? this would be huge for handheld devices with higher resolution displays than the Steam Deck - such as the ROG Ally which is 1920x1080p or the even more egregious Legion Go which is 2560x1600p. as far as i'm aware, the only option to do this right now is either 1: make gamescope think your panel is external with a forked version of gamescope or 2: rely on third-party extensions to access "hidden" dev options that end users should definitely not be messing with 2. adding in a way for users to define the default resolution that gamescope should use for games in an embedded context like gamescope-session, offering an easy way to bypass the 720p restriction within steam without having to go into every game entry and change Default -> Native (or whatever other resolution you'd prefer). this is probably a better option something like always defaulting to a monitor's native resolution in case people hook up 4K monitors or TVs to a Steam Deck so they're not left with 5fps in games unexpectedly.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).
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 https://github.com/ValveSoftware/gamescope/pull/1527, right?
This has been superseded by https://github.com/ValveSoftware/gamescope/pull/1527, right?
I think so, @lostgoat ?