mirror of
https://github.com/moraroy/NonSteamLaunchers-On-Steam-Deck.git
synced 2025-02-01 11:22:37 +01:00
Add files via upload
This commit is contained in:
parent
1c027a67b2
commit
4f3805a5d9
@ -387,14 +387,14 @@ print(sys.path)
|
|||||||
# Create an empty dictionary to store the app IDs
|
# Create an empty dictionary to store the app IDs
|
||||||
app_ids = {}
|
app_ids = {}
|
||||||
|
|
||||||
# Get the highest existing key
|
def find_first_available_key(shortcuts):
|
||||||
if shortcuts['shortcuts']:
|
# Start from 0
|
||||||
highest_key = max(int(key) for key in shortcuts['shortcuts'].keys())
|
key = 0
|
||||||
else:
|
# While the key exists in the shortcuts, increment the key
|
||||||
highest_key = -1
|
while str(key) in shortcuts:
|
||||||
|
key += 1
|
||||||
# Start the counter from the next available number
|
# Return the first available key
|
||||||
counter = highest_key + 1
|
return key
|
||||||
|
|
||||||
def create_new_entry(shortcutdirectory, appname, launchoptions, startingdir):
|
def create_new_entry(shortcutdirectory, appname, launchoptions, startingdir):
|
||||||
global new_shortcuts_added
|
global new_shortcuts_added
|
||||||
@ -465,19 +465,14 @@ def create_new_entry(shortcutdirectory, appname, launchoptions, startingdir):
|
|||||||
'Hero': hero64,
|
'Hero': hero64,
|
||||||
'Logo': logo64,
|
'Logo': logo64,
|
||||||
}
|
}
|
||||||
# Add the new entry to the shortcuts dictionary and add proton
|
# Add the new entry to the shortcuts dictionary and add proton # Find the first available key
|
||||||
# Use the counter for the key
|
key = find_first_available_key(shortcuts['shortcuts'])
|
||||||
shortcuts['shortcuts'][str(counter)] = new_entry # Use the counter as the key
|
# Use the key for the new entry
|
||||||
decky_shortcuts[appname] = decky_entry
|
shortcuts['shortcuts'][str(key)] = new_entry
|
||||||
print(f"Added new entry for {appname} to shortcuts.")
|
print(f"Added new entry for {appname} to shortcuts.")
|
||||||
new_shortcuts_added = True
|
new_shortcuts_added = True
|
||||||
created_shortcuts.append(appname)
|
created_shortcuts.append(appname)
|
||||||
|
|
||||||
counter += 1 # Increment the counter after adding the new entry
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
create_new_entry(os.environ.get('epicshortcutdirectory'), 'Epic Games', os.environ.get('epiclaunchoptions'), os.environ.get('epicstartingdir'))
|
create_new_entry(os.environ.get('epicshortcutdirectory'), 'Epic Games', os.environ.get('epiclaunchoptions'), os.environ.get('epicstartingdir'))
|
||||||
create_new_entry(os.environ.get('gogshortcutdirectory'), 'Gog Galaxy', os.environ.get('goglaunchoptions'), os.environ.get('gogstartingdir'))
|
create_new_entry(os.environ.get('gogshortcutdirectory'), 'Gog Galaxy', os.environ.get('goglaunchoptions'), os.environ.get('gogstartingdir'))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user