Commit 8ca1ae91 authored by Vladislav's avatar Vladislav

Updates for name_desktop and create_pw_comment

parent b51913dc
...@@ -908,28 +908,29 @@ search_desktop_file () { ...@@ -908,28 +908,29 @@ search_desktop_file () {
create_pw_comment () { create_pw_comment () {
search_desktop_file search_desktop_file
unset DESKTOP_NAME_FILE PW_SHORTCUT_PROXY unset DESKTOP_NAME_FILE PW_SHORTCUT_PROXY
if [[ -n ${DESKTOP_FILES_ARRAY[0]} ]] ; then if [[ -n $DESKTOP_NAME_YAD ]] ; then
for df in "${DESKTOP_FILES_ARRAY[@]}" ; do DESKTOP_NAME_FILE="${DESKTOP_NAME_YAD//.desktop/}"
df="${df//"$PORT_WINE_PATH/"/}" unset DESKTOP_NAME_YAD
DESKTOP_NAME_FILE="${df//.desktop/}" elif [[ -n $name_desktop ]] ; then
done DESKTOP_NAME_FILE="$name_desktop"
unset name_desktop
elif [[ -n ${DESKTOP_FILES_ARRAY[0]} ]] \
&& [[ -z ${DESKTOP_FILES_ARRAY[1]} ]] ; then
DESKTOP_NAME_FILE="${DESKTOP_FILES_ARRAY[0]//"$PORT_WINE_PATH/"/}"
DESKTOP_NAME_FILE="${DESKTOP_NAME_FILE//.desktop/}"
fi fi
if [[ -z "${PW_COMMENT_DB}" ]] ; then if [[ -z "${PW_COMMENT_DB}" ]] ; then
[[ $FILE_DESCRIPTION != "" ]] && FILE_DESCRIPTION_ABBR=$(make_abbreviation "$FILE_DESCRIPTION") [[ -n $PORTPROTON_NAME ]] && PORTPROTON_NAME_ABBR=$(make_abbreviation "$PORTPROTON_NAME")
[[ $PORTPROTON_NAME != "" ]] && PORTPROTON_NAME_ABBR=$(make_abbreviation "$PORTPROTON_NAME") [[ -n $FILE_DESCRIPTION ]] && FILE_DESCRIPTION_ABBR=$(make_abbreviation "$FILE_DESCRIPTION")
if [[ -n $DESKTOP_NAME_FILE ]] && [[ $DESKTOP_NAME_FILE != "" ]] ; then if [[ -n $DESKTOP_NAME_FILE ]] ; then
PW_COMMENT_DB="${translations[Launching]} <b>$(print_wrapped "$DESKTOP_NAME_FILE" "50")</b>$(seconds_to_time "$TIME_CURRENT")" PW_COMMENT_DB="${translations[Launching]} <b>$(print_wrapped "$DESKTOP_NAME_FILE" "50")</b>$(seconds_to_time "$TIME_CURRENT")"
PW_SHORTCUT_PROXY="$DESKTOP_NAME_FILE" PW_SHORTCUT_PROXY="$DESKTOP_NAME_FILE"
elif [[ ${PORTPROTON_NAME^^} =~ ${PORTWINE_DB^^} ]] && [[ ${PORTPROTON_NAME^^} != "${PORTWINE_DB^^}" ]] ; then elif [[ ${PORTPROTON_NAME^^} =~ ${PORTWINE_DB^^} && ${PORTPROTON_NAME} != "${PORTWINE_DB}" ]] \
PW_COMMENT_DB="${translations[Launching]} <b>$(print_wrapped "$PORTPROTON_NAME" "50")</b>$(seconds_to_time "$TIME_CURRENT")" || [[ ${#PORTPROTON_NAME_ABBR} -gt 2 && ${PORTPROTON_NAME_ABBR^^} =~ ${PORTWINE_DB^^} ]] ; then
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_COMMENT_DB="${translations[Launching]} <b>$(print_wrapped "$PORTPROTON_NAME" "50")</b>$(seconds_to_time "$TIME_CURRENT")"
PW_SHORTCUT_PROXY="$PORTPROTON_NAME" PW_SHORTCUT_PROXY="$PORTPROTON_NAME"
elif [[ ${FILE_DESCRIPTION^^} =~ ${PORTWINE_DB^^} ]] && [[ ${FILE_DESCRIPTION^^} != "${PORTWINE_DB^^}" ]] ; then elif [[ ${FILE_DESCRIPTION^^} =~ ${PORTWINE_DB^^} && ${FILE_DESCRIPTION} != "${PORTWINE_DB}" ]] \
PW_COMMENT_DB="${translations[Launching]} <b>$(print_wrapped "$FILE_DESCRIPTION" "50")</b>$(seconds_to_time "$TIME_CURRENT")" || [[ ${#FILE_DESCRIPTION_ABBR} -gt 2 && ${FILE_DESCRIPTION_ABBR^^} =~ ${PORTWINE_DB^^} ]] ; then
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_COMMENT_DB="${translations[Launching]} <b>$(print_wrapped "$FILE_DESCRIPTION" "50")</b>$(seconds_to_time "$TIME_CURRENT")"
PW_SHORTCUT_PROXY="$FILE_DESCRIPTION" PW_SHORTCUT_PROXY="$FILE_DESCRIPTION"
else else
...@@ -5588,12 +5589,13 @@ portwine_create_shortcut () { ...@@ -5588,12 +5589,13 @@ portwine_create_shortcut () {
for rm in "${DESKTOP_FILES_ARRAY[@]}" ; do for rm in "${DESKTOP_FILES_ARRAY[@]}" ; do
rm -f "$rm" rm -f "$rm"
done done
[[ $name_desktop == "" ]] && create_pw_comment && export name_desktop="$PW_SHORTCUT_PROXY"
fi fi
else else
try_remove_file "${PORT_WINE_PATH}/${name_desktop}.desktop" try_remove_file "${PORT_WINE_PATH}/${name_desktop}.desktop"
fi fi
[[ -z $name_desktop ]] && unset name_desktop && export name_desktop="$DESKTOP_NAME_FILE"
echo "[Desktop Entry]" > "${PORT_WINE_PATH}/${name_desktop}.desktop" echo "[Desktop Entry]" > "${PORT_WINE_PATH}/${name_desktop}.desktop"
echo "Name=${name_desktop}" >> "${PORT_WINE_PATH}/${name_desktop}.desktop" echo "Name=${name_desktop}" >> "${PORT_WINE_PATH}/${name_desktop}.desktop"
if check_flatpak if check_flatpak
...@@ -6178,6 +6180,7 @@ button_click () { ...@@ -6178,6 +6180,7 @@ button_click () {
(( count++ )) (( count++ ))
done done
fi fi
export DESKTOP_NAME_YAD="${PW_YAD_SET//"$PORT_WINE_PATH/"/}"
if check_flatpak if check_flatpak
then PW_EXEC_FROM_DESKTOP="$(grep Exec "$PW_YAD_SET" | head -n 1 | sed 's|flatpak run ru.linux_gaming.PortProton|\"${PORT_SCRIPTS_PATH}/start.sh\"|' | awk -F'=' '{print $2}')" then PW_EXEC_FROM_DESKTOP="$(grep Exec "$PW_YAD_SET" | head -n 1 | sed 's|flatpak run ru.linux_gaming.PortProton|\"${PORT_SCRIPTS_PATH}/start.sh\"|' | awk -F'=' '{print $2}')"
else PW_EXEC_FROM_DESKTOP="$(grep Exec "$PW_YAD_SET" | head -n 1 | awk -F"=env " '{print $2}')" else PW_EXEC_FROM_DESKTOP="$(grep Exec "$PW_YAD_SET" | head -n 1 | awk -F"=env " '{print $2}')"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment