mirror of
https://github.com/moraroy/NonSteamLaunchers-On-Steam-Deck.git
synced 2024-11-20 08:09:18 +01:00
Add files via upload
This commit is contained in:
parent
0c5513c409
commit
b3ff527734
@ -875,7 +875,7 @@ if amazon_games:
|
||||
|
||||
|
||||
|
||||
#Push down when more scanners are added
|
||||
# Push down when more scanners are added
|
||||
# Only write back to the shortcuts.vdf and config.vdf files if new shortcuts were added or compattools changed
|
||||
if new_shortcuts_added or shortcuts_updated:
|
||||
print(f"Saving new config and shortcuts files")
|
||||
@ -884,10 +884,34 @@ if new_shortcuts_added or shortcuts_updated:
|
||||
file.write(conf)
|
||||
with open(f"{logged_in_home}/.steam/root/userdata/{steamid3}/config/shortcuts.vdf", 'wb') as file:
|
||||
file.write(vdf.binary_dumps(shortcuts))
|
||||
|
||||
# Print the created shortcuts
|
||||
if created_shortcuts:
|
||||
print("Created Shortcuts:")
|
||||
for name in created_shortcuts:
|
||||
print(name)
|
||||
|
||||
# Assuming 'games' is a list of game dictionaries
|
||||
games = [shortcut for shortcut in shortcuts['shortcuts'].values()]
|
||||
|
||||
for game in games:
|
||||
# Skip if 'appname' or 'exe' is None
|
||||
if game.get('appname') is None or game.get('exe') is None:
|
||||
continue
|
||||
|
||||
# Create a dictionary to hold the shortcut information
|
||||
shortcut_info = {
|
||||
'appid': str(game.get('appid')),
|
||||
'appname': game.get('appname'),
|
||||
'exe': game.get('exe'),
|
||||
'StartDir': game.get('StartDir'),
|
||||
'icon': f"{logged_in_home}/.steam/root/userdata/{steamid3}/config/grid/{get_file_name('icons', game.get('appid'))}",
|
||||
'LaunchOptions': game.get('LaunchOptions'),
|
||||
'GameID': game.get('GameID', "default_game_id") # Use a default value if game_id is not defined
|
||||
}
|
||||
|
||||
# Print the shortcut information in JSON format
|
||||
print(json.dumps(shortcut_info), flush=True)
|
||||
|
||||
print("All finished!")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user