mirror of
https://github.com/moraroy/NonSteamLaunchers-On-Steam-Deck.git
synced 2024-12-21 15:21:52 +01:00
Add custom website to env vars
Custom websites are now passed to env_vars for processing by NSL
This commit is contained in:
parent
f0977d6ebe
commit
4976a9ca12
@ -2551,26 +2551,7 @@ if [ ${#custom_websites[@]} -gt 0 ]; then
|
||||
|
||||
# Convert the custom_websites array to a string
|
||||
custom_websites_str=$(IFS=", "; echo "${custom_websites[*]}")
|
||||
|
||||
# Iterate over each custom website
|
||||
for custom_website in "${custom_websites[@]}"; do
|
||||
# Remove any leading or trailing spaces from the custom website URL
|
||||
custom_website="$(echo -e "${custom_website}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"
|
||||
|
||||
# Remove the 'http://' or 'https://' prefix and the 'www.' prefix, if present
|
||||
clean_website="${custom_website#http://}"
|
||||
clean_website="${clean_website#https://}"
|
||||
clean_website="${clean_website#www.}"
|
||||
|
||||
# Extract the name of the website by removing everything after the first '/'
|
||||
website_name="${clean_website%%/*}"
|
||||
|
||||
# Remove the top-level domain (e.g. '.com') from the website name
|
||||
website_name="${website_name%.*}"
|
||||
|
||||
# Capitalize the first letter of the website name
|
||||
website_name="$(tr '[:lower:]' '[:upper:]' <<< "${website_name:0:1}")${website_name:1}"
|
||||
done
|
||||
echo "export custom_websites_str=$custom_websites_str" >> ${logged_in_home}/.config/systemd/user/env_vars
|
||||
fi
|
||||
|
||||
# Create the download directory if it doesn't exist
|
||||
|
Loading…
Reference in New Issue
Block a user