Commit 7033cb8c authored by Mikhail Tergoev's avatar Mikhail Tergoev

Merge branch 'mega_bash_func' of github.com:Htylol/PortWINE into Htylol-mega_bash_func

parents 994f0350 20d89292
...@@ -40,7 +40,7 @@ source "$PORT_SCRIPTS_PATH/functions_helper" ...@@ -40,7 +40,7 @@ source "$PORT_SCRIPTS_PATH/functions_helper"
export PW_START_PID="$$" export PW_START_PID="$$"
export NO_AT_BRIDGE="1" export NO_AT_BRIDGE="1"
export GDK_BACKEND="x11" export GDK_BACKEND="x11"
IFS=' ' read -r -a pw_full_command_line <<< "$0 $*" read -r -a pw_full_command_line <<< "$0 $*"
export pw_full_command_line export pw_full_command_line
export orig_IFS="$IFS" export orig_IFS="$IFS"
...@@ -358,7 +358,7 @@ EOF ...@@ -358,7 +358,7 @@ EOF
else else
try_remove_file "${PORT_WINE_TMP_PATH}"/pp_pfx_unpack.sh try_remove_file "${PORT_WINE_TMP_PATH}"/pp_pfx_unpack.sh
if [[ -f "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/.create_shortcut" ]] ; then if [[ -f "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/.create_shortcut" ]] ; then
while IFS= read -r line while read -r line
do do
export portwine_exe="$PORT_WINE_PATH/data/prefixes/$PW_PREFIX_NAME/$line" export portwine_exe="$PORT_WINE_PATH/data/prefixes/$PW_PREFIX_NAME/$line"
portwine_create_shortcut portwine_create_shortcut
...@@ -614,7 +614,7 @@ else ...@@ -614,7 +614,7 @@ else
desktop_file_new="${desktop_file//"$PORT_WINE_PATH/"/}" desktop_file_new="${desktop_file//"$PORT_WINE_PATH/"/}"
if [[ $desktop_file_new =~ .desktop$ ]] ; then if [[ $desktop_file_new =~ .desktop$ ]] ; then
if [[ ! $desktop_file_new =~ (PortProton|readme) ]] ; then if [[ ! $desktop_file_new =~ (PortProton|readme) ]] ; then
while IFS= read -r line1 ; do while read -r line1 ; do
if [[ $line1 =~ ^Exec= ]] ; then if [[ $line1 =~ ^Exec= ]] ; then
if check_flatpak ; then if check_flatpak ; then
PW_NAME_D_ICON["$AMOUNT_GENERATE_BUTTONS"]=${line1//Exec=flatpak run ru.linux_gaming.PortProton /} PW_NAME_D_ICON["$AMOUNT_GENERATE_BUTTONS"]=${line1//Exec=flatpak run ru.linux_gaming.PortProton /}
...@@ -633,7 +633,7 @@ else ...@@ -633,7 +633,7 @@ else
PW_NAME_D_ICON["$AMOUNT_GENERATE_BUTTONS"]=${PW_NAME_D_ICON["$AMOUNT_GENERATE_BUTTONS"]//Exec=env \"$PORT_SCRIPTS_PATH\/start.sh\" /} PW_NAME_D_ICON["$AMOUNT_GENERATE_BUTTONS"]=${PW_NAME_D_ICON["$AMOUNT_GENERATE_BUTTONS"]//Exec=env \"$PORT_SCRIPTS_PATH\/start.sh\" /}
sed -i "s|Exec=env \"$PORT_SCRIPTS_PATH/start.sh\"|Exec=flatpak run ru.linux_gaming.PortProton|" "$desktop_file" sed -i "s|Exec=env \"$PORT_SCRIPTS_PATH/start.sh\"|Exec=flatpak run ru.linux_gaming.PortProton|" "$desktop_file"
fi fi
while IFS=' ' read -r -a line2 ; do while read -r -a line2 ; do
if [[ \"${line2[0]//#@_@#/ }\" == "${PW_NAME_D_ICON["$AMOUNT_GENERATE_BUTTONS"]}" ]] ; then if [[ \"${line2[0]//#@_@#/ }\" == "${PW_NAME_D_ICON["$AMOUNT_GENERATE_BUTTONS"]}" ]] ; then
PW_GAME_TIME["$AMOUNT_GENERATE_BUTTONS"]=${line2[2]} PW_GAME_TIME["$AMOUNT_GENERATE_BUTTONS"]=${line2[2]}
break break
...@@ -643,9 +643,9 @@ else ...@@ -643,9 +643,9 @@ else
done < "$PORT_WINE_TMP_PATH/statistics" done < "$PORT_WINE_TMP_PATH/statistics"
if [[ $SORT_WITH_TIME == enabled ]] && [[ ${line2[3]} == NEW_DESKTOP ]] ; then if [[ $SORT_WITH_TIME == enabled ]] && [[ ${line2[3]} == NEW_DESKTOP ]] ; then
sed -i "s/${line2[1]} ${line2[2]} NEW_DESKTOP/${line2[1]} ${line2[2]} OLD_DESKTOP/" "$PORT_WINE_TMP_PATH/statistics" sed -i "s/${line2[1]} ${line2[2]} NEW_DESKTOP/${line2[1]} ${line2[2]} OLD_DESKTOP/" "$PORT_WINE_TMP_PATH/statistics"
IFS=' ' read -r -a PW_AMOUNT_NEW_DESKTOP <<< "${PW_AMOUNT_NEW_DESKTOP[*]} $AMOUNT_GENERATE_BUTTONS" PW_AMOUNT_NEW_DESKTOP+=("$AMOUNT_GENERATE_BUTTONS")
else else
IFS=' ' read -r -a PW_AMOUNT_OLD_DESKTOP <<< "${PW_AMOUNT_OLD_DESKTOP[*]} $AMOUNT_GENERATE_BUTTONS" PW_AMOUNT_OLD_DESKTOP+=("$AMOUNT_GENERATE_BUTTONS")
fi fi
(( AMOUNT_GENERATE_BUTTONS++ )) (( AMOUNT_GENERATE_BUTTONS++ ))
fi fi
...@@ -758,7 +758,7 @@ else ...@@ -758,7 +758,7 @@ else
# AI_TOP_GAMES используется для сортировки автоинсталлов (работает на эмуляторы тоже) # AI_TOP_GAMES используется для сортировки автоинсталлов (работает на эмуляторы тоже)
AI_AMOUNT_GAMES="0" && AI_AMOUNT_EMULS="0" && AI_AMOUNT_ARRAY="0" AI_AMOUNT_GAMES="0" && AI_AMOUNT_EMULS="0" && AI_AMOUNT_ARRAY="0"
for ai_file in "$PORT_SCRIPTS_PATH"/pw_autoinstall/* ; do for ai_file in "$PORT_SCRIPTS_PATH"/pw_autoinstall/* ; do
while IFS= read -r line ; do while read -r line ; do
[[ $line =~ "##########" ]] && break [[ $line =~ "##########" ]] && break
[[ $line =~ "# type: " ]] && AI_TYPE["$AI_AMOUNT_ARRAY"]="${line//# type: /}" [[ $line =~ "# type: " ]] && AI_TYPE["$AI_AMOUNT_ARRAY"]="${line//# type: /}"
[[ $line =~ "# name: " ]] && AI_NAME["$AI_AMOUNT_ARRAY"]="${line//# name: /}" [[ $line =~ "# name: " ]] && AI_NAME["$AI_AMOUNT_ARRAY"]="${line//# name: /}"
...@@ -771,14 +771,14 @@ else ...@@ -771,14 +771,14 @@ else
done < "$ai_file" done < "$ai_file"
AI_FILE="${ai_file//"$PORT_SCRIPTS_PATH/pw_autoinstall/"/}" AI_FILE="${ai_file//"$PORT_SCRIPTS_PATH/pw_autoinstall/"/}"
AI_FILE_CHECK="$AI_FILE=$AI_AMOUNT_ARRAY" AI_FILE_CHECK="$AI_FILE=$AI_AMOUNT_ARRAY"
IFS=' ' read -r -a AI_FILE_ARRAY <<< "${AI_FILE_ARRAY[*]} $AI_FILE" AI_FILE_ARRAY+=("$AI_FILE")
if [[ $AI_TOP_GAMES =~ ${AI_FILE_CHECK//=*/} ]] ; then if [[ $AI_TOP_GAMES =~ ${AI_FILE_CHECK//=*/} ]] ; then
IFS=' ' read -r -a AI_TRUE_FILE <<< "${AI_TRUE_FILE[*]} $AI_FILE_CHECK" AI_TRUE_FILE+=("$AI_FILE_CHECK")
else else
if [[ ${AI_NAME["$AI_AMOUNT_ARRAY"]} =~ \(ENG\) ]] ; then if [[ ${AI_NAME["$AI_AMOUNT_ARRAY"]} =~ \(ENG\) ]] ; then
IFS=' ' read -r -a AI_FILE_ENG <<< "${AI_FILE_ENG[*]} $AI_AMOUNT_ARRAY" AI_FILE_ENG+=("$AI_AMOUNT_ARRAY")
else else
IFS=' ' read -r -a AI_FILE_UNSORTED <<< "${AI_FILE_UNSORTED[*]} $AI_AMOUNT_ARRAY" AI_FILE_UNSORTED+=("$AI_AMOUNT_ARRAY")
fi fi
fi fi
(( AI_AMOUNT_ARRAY++ )) (( AI_AMOUNT_ARRAY++ ))
...@@ -786,8 +786,9 @@ else ...@@ -786,8 +786,9 @@ else
for ai_sort in $AI_TOP_GAMES ; do for ai_sort in $AI_TOP_GAMES ; do
if [[ ${AI_TRUE_FILE[*]} =~ $ai_sort ]] ; then if [[ ${AI_TRUE_FILE[*]} =~ $ai_sort ]] ; then
AI_TRUE_FILE_NEW=(${AI_TRUE_FILE[@]//$ai_sort=/}) AI_TRUE_FILE_NEW=("${AI_TRUE_FILE[@]//$ai_sort=/}")
AI_FILE_SORTED+=(${AI_TRUE_FILE_NEW[@]//*=*/}) AI_TRUE_FILE_NEW=("${AI_TRUE_FILE_NEW[*]//*=*/}")
AI_FILE_SORTED+=("${AI_TRUE_FILE_NEW[*]// /}")
fi fi
done done
......
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