This commit is contained in:
2024-10-23 14:57:38 +05:00
parent 5c6b863edf
commit bd2f9fb1e6
2 changed files with 70 additions and 70 deletions

View File

@ -500,70 +500,7 @@ if [[ -f "${portwine_exe}" ]] ; then
PW_SHORTCUT="${translations[DELETE SHORTCUT]}!$PW_GUI_ICON_PATH/$BUTTON_SIZE.png!${translations[Delete shortcut for select file...]}:98"
fi
search_desktop_file
unset DESKTOP_NAME_FILE PW_SHORTCUT_PROXY
if [[ -n ${DESKTOP_FILES_ARRAY[0]} ]] ; then
for df in "${DESKTOP_FILES_ARRAY[@]}" ; do
df="${df//"$PORT_WINE_PATH/"/}"
DESKTOP_NAME_FILE="${df//.desktop/}"
done
fi
if [[ -z "${PW_COMMENT_DB}" ]] ; then
[[ $FILE_DESCRIPTION != "" ]] && FILE_DESCRIPTION_ABBR=$(make_abbreviation "$FILE_DESCRIPTION")
[[ $PORTPROTON_NAME != "" ]] && PORTPROTON_NAME_ABBR=$(make_abbreviation "$PORTPROTON_NAME")
if [[ -n $DESKTOP_NAME_FILE ]] && [[ $DESKTOP_NAME_FILE != "" ]] ; then
PW_COMMENT_DB="${translations[Launching]} <b>$(print_wrapped "$DESKTOP_NAME_FILE" "50")</b>$(seconds_to_time "$TIME_CURRENT")"
PW_SHORTCUT_PROXY="$DESKTOP_NAME_FILE"
elif [[ ${PORTPROTON_NAME^^} =~ ${PORTWINE_DB^^} ]] && [[ ${PORTPROTON_NAME^^} != "${PORTWINE_DB^^}" ]] ; then
PW_COMMENT_DB="${translations[Launching]} <b>$(print_wrapped "$PORTPROTON_NAME" "50")</b>$(seconds_to_time "$TIME_CURRENT")"
PW_SHORTCUT_PROXY="$PORTPROTON_NAME"
elif (( ${#PORTPROTON_NAME_ABBR} > 2 )) && [[ ${PORTPROTON_NAME_ABBR^^} =~ ${PORTWINE_DB^^} ]] ; then
PW_COMMENT_DB="${translations[Launching]} <b>$(print_wrapped "$PORTPROTON_NAME" "50")</b>$(seconds_to_time "$TIME_CURRENT")"
PW_SHORTCUT_PROXY="$PORTPROTON_NAME"
elif [[ ${FILE_DESCRIPTION^^} =~ ${PORTWINE_DB^^} ]] && [[ ${FILE_DESCRIPTION^^} != "${PORTWINE_DB^^}" ]] ; then
PW_COMMENT_DB="${translations[Launching]} <b>$(print_wrapped "$FILE_DESCRIPTION" "50")</b>$(seconds_to_time "$TIME_CURRENT")"
PW_SHORTCUT_PROXY="$FILE_DESCRIPTION"
elif (( ${#FILE_DESCRIPTION_ABBR} > 2 )) && [[ ${FILE_DESCRIPTION_ABBR^^} =~ ${PORTWINE_DB^^} ]] ; then
PW_COMMENT_DB="${translations[Launching]} <b>$(print_wrapped "$FILE_DESCRIPTION" "50")</b>$(seconds_to_time "$TIME_CURRENT")"
PW_SHORTCUT_PROXY="$FILE_DESCRIPTION"
else
unset PORTWINE_DB_PROXY PORTWINE_DB_NEW
PORTWINE_DB="${PORTWINE_DB//_/ }"
if [[ ${PORTWINE_DB:0:1} =~ [a-z] ]] ; then
PORTWINE_DB_UPPER="${PORTWINE_DB^^}"
PORTWINE_DB="${PORTWINE_DB_UPPER:0:1}${PORTWINE_DB:1}"
fi
if (( ${#PORTWINE_DB} > 3 )) ; then
for ((i=0 ; i<${#PORTWINE_DB} ; i++)) ; do
if [[ ${PORTWINE_DB:i:2} =~ ([a-z][A-Z]|[a-z][0-9]) ]] \
&& [[ ! ${PORTWINE_DB:i:3} =~ ([a-z][A-Z]" "|[a-z][0-9]" ") ]] ; then
PORTWINE_DB_PROXY+="${PORTWINE_DB:i:1} "
elif [[ ${PORTWINE_DB:i:3} =~ [0-9][0-9][a-zA-Z] ]] ; then
PORTWINE_DB_PROXY+="${PORTWINE_DB:i:2} "
((i++))
else
PORTWINE_DB_PROXY+="${PORTWINE_DB:i:1}"
fi
done
for ((i=0 ; i<${#PORTWINE_DB_PROXY} ; i++)) ; do
if [[ ${PORTWINE_DB_PROXY:i:2} =~ " "[a-z] ]] ; then
PORTWINE_DB_UPPER="${PORTWINE_DB_PROXY:i:2}"
PORTWINE_DB_NEW+="${PORTWINE_DB_UPPER^^}"
((i++))
else
PORTWINE_DB_NEW+="${PORTWINE_DB_PROXY:i:1}"
fi
done
else
PORTWINE_DB_NEW="$PORTWINE_DB"
fi
PW_COMMENT_DB="${translations[Launching]} <b>$(print_wrapped "$PORTWINE_DB_NEW" "50")</b>$(seconds_to_time "$TIME_CURRENT")"
PW_SHORTCUT_PROXY="$PORTWINE_DB_NEW"
fi
else
PW_COMMENT_DB="$PW_COMMENT_DB$(seconds_to_time "$TIME_CURRENT")"
PW_SHORTCUT_PROXY="$DESKTOP_NAME_FILE"
fi
create_pw_comment
export KEY_START="$RANDOM"
if [[ "${PW_GUI_START}" == "NOTEBOOK" ]] ; then