From d6376ff9fa0739ae163690edd08e2c3edc0abb81 Mon Sep 17 00:00:00 2001 From: the Sane <3657071+the-sane@users.noreply.github.com> Date: Sat, 9 Apr 2022 10:51:29 -0600 Subject: [PATCH 1/7] Prepare for shaders location change in 3.17 --- lug-helper.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lug-helper.sh b/lug-helper.sh index ac38d66..533013e 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -102,6 +102,9 @@ install_path="drive_c/Program Files/Roberts Space Industries/$sc_base_dir" live_dir="LIVE" ptu_dir="PTU" +# AppData directory +appdata_path="drive_c/users?/appdata?/something/local/idontknow/starcitizen" + # Remaining directory paths are set at the end of the getdirs() function ######## Runners ########################################################### @@ -525,7 +528,7 @@ getdirs() { # The location within the USER directory to which the game exports keybinds keybinds_dir="$user_dir/Controls/Mappings" # Shaders directory - shaders_dir="$user_dir/shaders" + shaders_dir="$wine_prefix/$appdata_path/shaders" # dxvk cache file dxvk_cache="$game_path/$live_or_ptu/StarCitizen.dxvk-cache" # Where to store backed up keybinds From f072378617efe5c0a93762caf35400dd0e49c750 Mon Sep 17 00:00:00 2001 From: the Sane <3657071+the-sane@users.noreply.github.com> Date: Sat, 9 Apr 2022 10:53:28 -0600 Subject: [PATCH 2/7] Bump version --- lug-helper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lug-helper.sh b/lug-helper.sh index 533013e..be997ab 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -173,7 +173,7 @@ lug_wiki="https://github.com/starcitizen-lug/information-howtos/wiki" # Github repo and script version info repo="starcitizen-lug/lug-helper" releases_url="https://github.com/$repo/releases" -current_version="v1.19" +current_version="v1.20" ############################################################################ ############################################################################ From eb48d00396b6964bda6f36faddbaa06805e18881 Mon Sep 17 00:00:00 2001 From: Termuellinator Date: Fri, 22 Apr 2022 17:04:22 +0200 Subject: [PATCH 3/7] adapted rm_shaders() to the new appdata-location used with 3.17 --- lug-helper.sh | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/lug-helper.sh b/lug-helper.sh index be997ab..e7184ff 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -103,8 +103,7 @@ live_dir="LIVE" ptu_dir="PTU" # AppData directory -appdata_path="drive_c/users?/appdata?/something/local/idontknow/starcitizen" - +appdata_path="drive_c/users/$USER/AppData/Local/Star Citizen" # Remaining directory paths are set at the end of the getdirs() function ######## Runners ########################################################### @@ -1507,19 +1506,26 @@ rm_shaders() { # User cancelled and wants to return to the main menu, or error return 0 fi + + # Create an array containing all directories in the appdata_path + for appdata_list in "$wine_prefix/$appdata_path"/*; do + if [ -d "$appdata_list" ]; then + appdata_items+=("$appdata_list") + fi + done - # Sanity check - if [ ! -d "$shaders_dir" ]; then - message warning "Shaders directory not found. There is nothing to delete!\n\n$shaders_dir" - return 0 - fi - - # Delete the shader directory - if message question "The following directory will be deleted:\n\n$shaders_dir\n\nDo you want to proceed?"; then - debug_print continue "Deleting $shaders_dir..." - rm -r "$shaders_dir" - message info "Your shaders have been deleted!" - fi + # Delete shaders directory in every directory beginning with "sc-alpha" + for (( i=0; i<"${#appdata_items[@]}"; i++ )); do + if [[ ${appdata_items[i]} = "$wine_prefix/$appdata_path"/sc-alpha* ]]; then # check if the item in the array begins with sc-alpha + if [ -d "${appdata_items[i]}/shaders" ]; then # check if there is a shaders subfolder + if message question "The following directory will be deleted:\n\n${appdata_items[i]}/shaders\n\nDo you want to proceed?"; then + debug_print continue "Deleting ${appdata_items[i]}/shaders..." + rm -r "${appdata_items[i]}/shaders" + message info "Your shaders have been deleted!" + fi + fi + fi + done } # Delete DXVK cache From d6d28f14817e59530f4b07852ef614a211ed6e16 Mon Sep 17 00:00:00 2001 From: Termuellinator Date: Fri, 22 Apr 2022 17:15:37 +0200 Subject: [PATCH 4/7] quoted variable for space safety --- lug-helper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lug-helper.sh b/lug-helper.sh index e7184ff..22c5d0d 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -1516,7 +1516,7 @@ rm_shaders() { # Delete shaders directory in every directory beginning with "sc-alpha" for (( i=0; i<"${#appdata_items[@]}"; i++ )); do - if [[ ${appdata_items[i]} = "$wine_prefix/$appdata_path"/sc-alpha* ]]; then # check if the item in the array begins with sc-alpha + if [[ "${appdata_items[i]}" = "$wine_prefix/$appdata_path"/sc-alpha* ]]; then # check if the item in the array begins with sc-alpha if [ -d "${appdata_items[i]}/shaders" ]; then # check if there is a shaders subfolder if message question "The following directory will be deleted:\n\n${appdata_items[i]}/shaders\n\nDo you want to proceed?"; then debug_print continue "Deleting ${appdata_items[i]}/shaders..." From fe1733542ddb87e604552cbe92826a4120c4fb29 Mon Sep 17 00:00:00 2001 From: Termuellinator Date: Sat, 23 Apr 2022 11:12:51 +0200 Subject: [PATCH 5/7] added info message when no shaders directory is found --- lug-helper.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lug-helper.sh b/lug-helper.sh index 22c5d0d..c7c324b 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -1519,11 +1519,15 @@ rm_shaders() { if [[ "${appdata_items[i]}" = "$wine_prefix/$appdata_path"/sc-alpha* ]]; then # check if the item in the array begins with sc-alpha if [ -d "${appdata_items[i]}/shaders" ]; then # check if there is a shaders subfolder if message question "The following directory will be deleted:\n\n${appdata_items[i]}/shaders\n\nDo you want to proceed?"; then - debug_print continue "Deleting ${appdata_items[i]}/shaders..." - rm -r "${appdata_items[i]}/shaders" - message info "Your shaders have been deleted!" + debug_print continue "Deleting ${appdata_items[i]}/shaders..." + rm -r "${appdata_items[i]}/shaders" + message info "Your shaders have been deleted!" fi + elif [[ $i = $(( ${#appdata_items[@]} - 1 )) ]]; then # display message when end of array is reached and no shaders directories were found + message info "No more shader directories found" fi + elif [[ $i = $(( ${#appdata_items[@]} - 1 )) ]]; then # display message when end of array is reached and no shaders or sc-alpha directories were found + message info "No more shader directories found" fi done } From dffa971dc1d2feacda787cd6c66e3596cc8af980 Mon Sep 17 00:00:00 2001 From: Termuellinator Date: Mon, 2 May 2022 08:27:59 +0200 Subject: [PATCH 6/7] quoted lug_logo to avoid zenity bug if space is present in path - issue 36 --- lug-helper.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lug-helper.sh b/lug-helper.sh index c7c324b..7ee9cee 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -347,9 +347,9 @@ menu() { zen_options+=("${menu_options[i]}") fi done - + # Display the zenity radio button menu - choice="$(zenity --list --radiolist --width="480" --height="$menu_height" --text="$menu_text_zenity" --title="Star Citizen LUG Helper" --hide-header --cancel-label "$cancel_label" --window-icon=$lug_logo --column="" --column="Option" "${zen_options[@]}" 2>/dev/null)" + choice="$(zenity --list --radiolist --width="480" --height="$menu_height" --text="$menu_text_zenity" --title="Star Citizen LUG Helper" --hide-header --cancel-label "$cancel_label" --window-icon="$lug_logo" --column="" --column="Option" "${zen_options[@]}" 2>/dev/null)" # Loop through the options array to match the chosen option matched="false" From f99fe9b9961452fa6482c375bda4c17b2c13d1fe Mon Sep 17 00:00:00 2001 From: Termuellinator Date: Mon, 16 May 2022 15:40:12 +0200 Subject: [PATCH 7/7] harmonized style --- lug-helper.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lug-helper.sh b/lug-helper.sh index 7ee9cee..479afb4 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -1516,17 +1516,17 @@ rm_shaders() { # Delete shaders directory in every directory beginning with "sc-alpha" for (( i=0; i<"${#appdata_items[@]}"; i++ )); do - if [[ "${appdata_items[i]}" = "$wine_prefix/$appdata_path"/sc-alpha* ]]; then # check if the item in the array begins with sc-alpha + if [ "${appdata_items[i]}" = "$wine_prefix/$appdata_path"/sc-alpha* ]; then # check if the item in the array begins with sc-alpha if [ -d "${appdata_items[i]}/shaders" ]; then # check if there is a shaders subfolder if message question "The following directory will be deleted:\n\n${appdata_items[i]}/shaders\n\nDo you want to proceed?"; then debug_print continue "Deleting ${appdata_items[i]}/shaders..." rm -r "${appdata_items[i]}/shaders" message info "Your shaders have been deleted!" fi - elif [[ $i = $(( ${#appdata_items[@]} - 1 )) ]]; then # display message when end of array is reached and no shaders directories were found + elif [ $i = $(( "${#appdata_items[@]}" - 1 )) ]; then # display message when end of array is reached and no shaders directories were found message info "No more shader directories found" fi - elif [[ $i = $(( ${#appdata_items[@]} - 1 )) ]]; then # display message when end of array is reached and no shaders or sc-alpha directories were found + elif [ $i = $(( "${#appdata_items[@]}" - 1 )) ]; then # display message when end of array is reached and no shaders or sc-alpha directories were found message info "No more shader directories found" fi done