im working on a script but how do i get this # Construct the command to run…
- User
im working on a script but how do i get this # Construct the command to run command_suffix = ' '.join([option for option in selected_options_list] + [website for website in custom_websites if website and website.strip() != ''] + ([f'"SEPARATE APP IDS - CHECK THIS TO SEPARATE YOUR PREFIX'S"'] if separate_app_ids else []) + ([f'"Start Fresh"'] if start_fresh else [])) + "'" to make the output of this selection to come out like this? /bin/bash -c 'curl -Ls https://raw.githubusercontent.com/moraroy/NonSteamLaunchers-On-Steam-Deck/main/NonSteamLaunchers.sh | nohup /bin/bash -s -- "Epic Games" "SEPARATE APP IDS - CHECK THIS TO SEPARATE YOUR PREFIX'''S"'
- Assistant
To format the 'command_suffix' output as '/bin/bash -c 'curl -Ls [url] | nohup /bin/bash -s -- [options] [app ids]', you can modify the code as follows:
command_suffix = f"""/bin/bash -c 'curl -Ls https://raw.githubusercontent.com/moraroy/NonSteamLaunchers-On-Steam-Deck/main/NonSteamLaunchers.sh | nohup /bin/bash -s -- {" ".join([option for option in selected_options_list] + [website for website in custom_websites if website and website.strip() != ''] + ([f'"SEPARATE APP IDS - CHECK THIS TO SEPARATE YOUR PREFIX\'S"'] if separate_app_ids else []) + ([f'"Start Fresh"'] if start_fresh else [])])}'"""This code uses f-string formatting to dynamically insert the values into the command string. Make sure to replace
[url]with the appropriate URL and adjust any other variables as needed. - User
so this is the key here? ([f’“SEPARATE APP IDS - CHECK THIS TO SEPARATE YOUR PREFIX’S”’]
- Assistant
Yes, that part
[f'"SEPARATE APP IDS - CHECK THIS TO SEPARATE YOUR PREFIX\'S"'] if separate_app_ids else []is responsible for adding the option"SEPARATE APP IDS - CHECK THIS TO SEPARATE YOUR PREFIX'S"to the command ifseparate_app_idsisTrue. Ifseparate_app_idsisFalse, it will add an empty list[]instead.You can modify this part according to your needs, including adding different options or conditions. Just ensure the correct logic and formatting are maintained.
- User
so if i have this and run it what would the outcome look like in konsole? ([f’“SEPARATE APP IDS - CHECK THIS TO SEPARATE YOUR PREFIX’S”’]
- Assistant
If the
separate_app_idsvariable isTrueand you have the following code:command_suffix = f"""/bin/bash -c 'curl -Ls https://raw.githubusercontent.com/moraroy/NonSteamLaunchers-On-Steam-Deck/main/NonSteamLaunchers.sh | nohup /bin/bash -s -- {" ".join([option for option in selected_options_list] + [website for website in custom_websites if website and website.strip() != ''] + ([f'"SEPARATE APP IDS - CHECK THIS TO SEPARATE YOUR PREFIX\'S"'] if separate_app_ids else []) + ([f'"Start Fresh"'] if start_fresh else [])])}'"""The resulting value of
command_suffixwould be:'/bin/bash -c \'curl -Ls https://raw.githubusercontent.com/moraroy/NonSteamLaunchers-On-Steam-Deck/main/NonSteamLaunchers.sh | nohup /bin/bash -s -- "Epic Games" "SEPARATE APP IDS - CHECK THIS TO SEPARATE YOUR PREFIX\'S"\''If you print the
command_suffixvariable, it would look like this:/bin/bash -c 'curl -Ls https://raw.githubusercontent.com/moraroy/NonSteamLaunchers-On-Steam-Deck/main/NonSteamLaunchers.sh | nohup /bin/bash -s -- "Epic Games" "SEPARATE APP IDS - CHECK THIS TO SEPARATE YOUR PREFIX'S"'