mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-24 15:26:04 +00:00
feat(steam): first-run defaults for big art and the bouncing logo screensaver (#3087)
* feat(steam): first-run defaults for big art on Library home and the bouncing logo screensaver * fix(steam): seeded keys land in the root store when nested stores close on its last line
This commit is contained in:
1 parent
86ad1544a6
commit
e3b1b60914
4 files changed
+55
-4
No files matched your search
@@ -10,6 +10,7 @@ import tempfile
|
||||
DISPLAY = "External: gamescope|||Windowed"
|
||||
NATIVE_RESOLUTION = "EnableSteamNativeExternalResolution"
|
||||
SCREENSAVER_IN_GAME = ("Customization", "Screensaver", "WhileInGame")
|
||||
SCREENSAVER_CURRENT = ("Customization", "Screensaver", "CurrentScreensaver")
|
||||
TOKEN = re.compile(r'\s+|//[^\n]*|"(?:\\.|[^"\\])*"|[{}]')
|
||||
|
||||
|
||||
@@ -137,6 +138,10 @@ def seed_no_screensaver_in_game(text):
|
||||
return seed_value(text, SCREENSAVER_IN_GAME, '0')
|
||||
|
||||
|
||||
def seed_bouncing_logo(text):
|
||||
return seed_value(text, SCREENSAVER_CURRENT, 'steam-bouncinglogo')
|
||||
|
||||
|
||||
def atomic_write(path, text):
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
fd, temporary = tempfile.mkstemp(prefix='.' + path.name, dir=path.parent)
|
||||
@@ -179,6 +184,11 @@ def initialize_screensaver(steam_root):
|
||||
'== steam: no screensaver over a running game')
|
||||
|
||||
|
||||
def initialize_screensaver_choice(steam_root):
|
||||
return seed_once(steam_root, 'droiddeck-screensaver-choice-initialized', seed_bouncing_logo,
|
||||
'== steam: bouncing logo screensaver')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
status = 0
|
||||
try:
|
||||
@@ -186,7 +196,7 @@ if __name__ == '__main__':
|
||||
except (OSError, ValueError, RecursionError) as error:
|
||||
print('== steam: left UI scale unchanged: ' + str(error), file=sys.stderr)
|
||||
status = 1
|
||||
for what, step in (('native resolution', initialize_native_resolution), ('screensaver', initialize_screensaver)):
|
||||
for what, step in (('native resolution', initialize_native_resolution), ('screensaver', initialize_screensaver), ('screensaver choice', initialize_screensaver_choice)):
|
||||
try:
|
||||
step(sys.argv[1])
|
||||
except (OSError, ValueError, RecursionError) as error:
|
||||
|
||||
Reference in new issue
Block a user