This commit is contained in:
Roy 2023-07-26 16:10:58 -07:00 committed by GitHub
parent b2e126ac1e
commit 4d5aede5ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2731,9 +2731,6 @@ if [ ${#custom_websites[@]} -gt 0 ]; then
# Convert the custom_websites array to a string # Convert the custom_websites array to a string
custom_websites_str=$(IFS=", "; echo "${custom_websites[*]}") custom_websites_str=$(IFS=", "; echo "${custom_websites[*]}")
# Initialize an associative array to keep track of the number of entries for each base URL
declare -A base_url_counts
# Iterate over each custom website # Iterate over each custom website
for custom_website in "${custom_websites[@]}"; do for custom_website in "${custom_websites[@]}"; do
# Remove any leading or trailing spaces from the custom website URL # Remove any leading or trailing spaces from the custom website URL
@ -2753,16 +2750,6 @@ if [ ${#custom_websites[@]} -gt 0 ]; then
# Capitalize the first letter of the website name # Capitalize the first letter of the website name
website_name="$(tr '[:lower:]' '[:upper:]' <<< "${website_name:0:1}")${website_name:1}" website_name="$(tr '[:lower:]' '[:upper:]' <<< "${website_name:0:1}")${website_name:1}"
# Check if an entry has already been created for this base URL
if [[ ${base_url_counts[$website_name]} ]]; then
# An entry has already been created for this base URL, so increment the count and append it to the website name
((base_url_counts[$website_name]++))
website_name="${website_name} ${base_url_counts[$website_name]}"
else
# This is the first entry for this base URL, so initialize the count to 1
base_url_counts[$website_name]=1
fi
# Set the chromelaunchoptions variable for this website # Set the chromelaunchoptions variable for this website
chromelaunchoptions="run --branch=stable --arch=x86_64 --command=/app/bin/chrome --file-forwarding com.google.Chrome @@u @@ --window-size=1280,800 --force-device-scale-factor=1.00 --device-scale-factor=1.00 --kiosk https://$clean_website/ --chrome-kiosk-type=fullscreen --no-first-run --enable-features=OverlayScrollbar" chromelaunchoptions="run --branch=stable --arch=x86_64 --command=/app/bin/chrome --file-forwarding com.google.Chrome @@u @@ --window-size=1280,800 --force-device-scale-factor=1.00 --device-scale-factor=1.00 --kiosk https://$clean_website/ --chrome-kiosk-type=fullscreen --no-first-run --enable-features=OverlayScrollbar"
done done
@ -3034,19 +3021,6 @@ def get_steam_shortcut_id(exe, appname):
def create_new_entry(shortcutdirectory, appname, launchoptions, startingdir): def create_new_entry(shortcutdirectory, appname, launchoptions, startingdir):
# Load the contents of the shortcuts.vdf file into a dictionary
with open('$shortcuts_vdf_path', 'rb') as f:
existing_shortcuts = vdf.binary_load(f)
# Check if an entry with the same appname and exe values already exists
entry_exists = False
for entry in existing_shortcuts['shortcuts']:
if entry['appname'] == appname and entry['exe'] == shortcutdirectory:
entry_exists = True
break
# Only create a new entry if an existing entry was not found
if not entry_exists:
if shortcutdirectory != '' and launchoptions != '': if shortcutdirectory != '' and launchoptions != '':
exe = f'"{shortcutdirectory}"' exe = f'"{shortcutdirectory}"'
if shortcutdirectory != chromedirectory: if shortcutdirectory != chromedirectory: