Merge branch 'Htylol-added-lastlaunch' into devel

This commit is contained in:
Mikhail Tergoev 2025-03-06 19:21:52 +03:00
commit 9070d7ec07
5 changed files with 253 additions and 218 deletions

@ -7,13 +7,13 @@
msgid "" msgid ""
msgstr "Project-Id-Version: PACKAGE VERSION\n" msgstr "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-03-02 01:22+0500\n" "POT-Creation-Date: 2025-03-06 03:47+0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n" "Language: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
msgid "A running PortProton session was detected.\\nDo you want to end the " msgid "A running PortProton session was detected.\\nDo you want to end the "
@ -1293,12 +1293,6 @@ msgstr ""
msgid "Change settings gamescope for" msgid "Change settings gamescope for"
msgstr "" msgstr ""
msgid "<b>Gamescope is not detected on the system, to install it, run the "
"command in the terminal:\\nflatpak install -y runtime/org."
"freedesktop.Platform.VulkanLayer.gamescope/x86_64/$"
"%{GAMESCOPE_VERSION}%\\n(Can be selected and copied)</b>"
msgstr ""
msgid "<b>Gamescope is not detected on the system, please contact the " msgid "<b>Gamescope is not detected on the system, please contact the "
"manufacturer of your distribution\\nor search the Internet for " "manufacturer of your distribution\\nor search the Internet for "
"information on how to install gamescope on your system.</b>" "information on how to install gamescope on your system.</b>"
@ -1421,6 +1415,12 @@ msgstr ""
msgid "Show in days, hours, minutes" msgid "Show in days, hours, minutes"
msgstr "" msgstr ""
msgid "According to last launch"
msgstr ""
msgid "By time"
msgstr ""
msgid "Recommended value" msgid "Recommended value"
msgstr "" msgstr ""
@ -1476,11 +1476,10 @@ msgstr ""
msgid "Displays time spent in an application or game" msgid "Displays time spent in an application or game"
msgstr "" msgstr ""
msgid "Sort shortcuts by time" msgid "Sort shortcuts by"
msgstr "" msgstr ""
msgid "This setting sorts the shortcuts in the main menu depending on the " msgid "This setting sorts the shortcuts in the main menu"
"time spent in the application or game"
msgstr "" msgstr ""
msgid "GLOBAL SETTINGS (USER.CONF)" msgid "GLOBAL SETTINGS (USER.CONF)"
@ -1628,14 +1627,6 @@ msgstr ""
msgid "SAVE" msgid "SAVE"
msgstr "" msgstr ""
#, sh-format
msgid "PortProton v. ${install_ver}\n"
"scripts v. ${scripts_install_ver}"
msgstr ""
msgid "Copyright © $%DATE% Castro-Fidel (linux-gaming.ru)"
msgstr ""
msgid "This program comes with absolutely no warranty.\n" msgid "This program comes with absolutely no warranty.\n"
"See the License for details." "See the License for details."
msgstr "" msgstr ""

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-03-02 01:22+0500\n" "POT-Creation-Date: 2025-03-05 23:40+0500\n"
"PO-Revision-Date: 2024-11-13 08:18+0500\n" "PO-Revision-Date: 2024-11-13 08:18+0500\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -1679,17 +1679,6 @@ msgstr ""
msgid "Change settings gamescope for" msgid "Change settings gamescope for"
msgstr "Cambiar ajustes gamescope para" msgstr "Cambiar ajustes gamescope para"
msgid ""
"<b>Gamescope is not detected on the system, to install it, run the command "
"in the terminal:\\nflatpak install -y runtime/org.freedesktop.Platform."
"VulkanLayer.gamescope/x86_64/$%{GAMESCOPE_VERSION}%\\n(Can be selected and "
"copied)</b>"
msgstr ""
"<b>Gamescope no se detecta en el sistema, para instalarlo, ejecute el "
"comando en el terminal:\\n flatpak install -y runtime/org.freedesktop."
"Platform.VulkanLayer.gamescope/x86_64/$%{GAMESCOPE_VERSION}%\\n (Se puede "
"seleccionar y copiar)</b>"
msgid "" msgid ""
"<b>Gamescope is not detected on the system, please contact the manufacturer " "<b>Gamescope is not detected on the system, please contact the manufacturer "
"of your distribution\\nor search the Internet for information on how to " "of your distribution\\nor search the Internet for information on how to "
@ -1850,6 +1839,13 @@ msgstr ""
msgid "Show in days, hours, minutes" msgid "Show in days, hours, minutes"
msgstr "" msgstr ""
msgid "According to last launch"
msgstr ""
#, fuzzy
msgid "By time"
msgstr "Mostrar tiempo"
msgid "Recommended value" msgid "Recommended value"
msgstr "" msgstr ""
@ -1908,12 +1904,12 @@ msgstr "Mostrar tiempo"
msgid "Displays time spent in an application or game" msgid "Displays time spent in an application or game"
msgstr "Muestra el tiempo transcurrido en una aplicación o juego" msgstr "Muestra el tiempo transcurrido en una aplicación o juego"
msgid "Sort shortcuts by time" #, fuzzy
msgid "Sort shortcuts by"
msgstr "Ordenar accesos directos por tiempo" msgstr "Ordenar accesos directos por tiempo"
msgid "" #, fuzzy
"This setting sorts the shortcuts in the main menu depending on the time " msgid "This setting sorts the shortcuts in the main menu"
"spent in the application or game"
msgstr "" msgstr ""
"Esta configuración ordena los accesos directos en el menú principal según el " "Esta configuración ordena los accesos directos en el menú principal según el "
"tiempo transcurrido en la aplicación o juego" "tiempo transcurrido en la aplicación o juego"
@ -2079,17 +2075,6 @@ msgstr "ATRÁS"
msgid "SAVE" msgid "SAVE"
msgstr "AHORRAR" msgstr "AHORRAR"
#, sh-format
msgid ""
"PortProton v. ${install_ver}\n"
"scripts v. ${scripts_install_ver}"
msgstr ""
"PortProton v. ${install_ver}\n"
"scripts v. ${scripts_install_ver}"
msgid "Copyright © $%DATE% Castro-Fidel (linux-gaming.ru)"
msgstr "Copyright © $%DATE% Castro-Fidel (linux-gaming.ru)"
msgid "" msgid ""
"This program comes with absolutely no warranty.\n" "This program comes with absolutely no warranty.\n"
"See the License for details." "See the License for details."
@ -2194,6 +2179,28 @@ msgstr "Restarting STEAM... Please wait."
msgid "Please wait. downloading covers for" msgid "Please wait. downloading covers for"
msgstr "Por favor, espera. Descargando portadas para" msgstr "Por favor, espera. Descargando portadas para"
#~ msgid ""
#~ "<b>Gamescope is not detected on the system, to install it, run the "
#~ "command in the terminal:\\nflatpak install -y runtime/org.freedesktop."
#~ "Platform.VulkanLayer.gamescope/x86_64/$%{GAMESCOPE_VERSION}%\\n(Can be "
#~ "selected and copied)</b>"
#~ msgstr ""
#~ "<b>Gamescope no se detecta en el sistema, para instalarlo, ejecute el "
#~ "comando en el terminal:\\n flatpak install -y runtime/org.freedesktop."
#~ "Platform.VulkanLayer.gamescope/x86_64/$%{GAMESCOPE_VERSION}%\\n (Se puede "
#~ "seleccionar y copiar)</b>"
#, sh-format
#~ msgid ""
#~ "PortProton v. ${install_ver}\n"
#~ "scripts v. ${scripts_install_ver}"
#~ msgstr ""
#~ "PortProton v. ${install_ver}\n"
#~ "scripts v. ${scripts_install_ver}"
#~ msgid "Copyright © $%DATE% Castro-Fidel (linux-gaming.ru)"
#~ msgstr "Copyright © $%DATE% Castro-Fidel (linux-gaming.ru)"
#~ msgid "Change the version of WINDOWS 10 to WINDOWS 7 in the prefix" #~ msgid "Change the version of WINDOWS 10 to WINDOWS 7 in the prefix"
#~ msgstr "Cambiar la versión de Windows 10 a Windows 7 en el prefijo" #~ msgstr "Cambiar la versión de Windows 10 a Windows 7 en el prefijo"

@ -7,8 +7,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-03-02 01:22+0500\n" "POT-Creation-Date: 2025-03-05 23:40+0500\n"
"PO-Revision-Date: 2025-03-02 01:22+0500\n" "PO-Revision-Date: 2025-03-06 03:43+0500\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
"Language: ru_RU\n" "Language: ru_RU\n"
@ -1668,17 +1668,6 @@ msgstr ""
msgid "Change settings gamescope for" msgid "Change settings gamescope for"
msgstr "Изменить настройки Gamescope для" msgstr "Изменить настройки Gamescope для"
msgid ""
"<b>Gamescope is not detected on the system, to install it, run the command "
"in the terminal:\\nflatpak install -y runtime/org.freedesktop.Platform."
"VulkanLayer.gamescope/x86_64/$%{GAMESCOPE_VERSION}%\\n(Can be selected and "
"copied)</b>"
msgstr ""
"<b>Gamescope не найден в системе, для его установки выполните команду в "
"терминале:\\nflatpak install -y runtime/org.freedesktop.Platform.VulkanLayer."
"gamescope/x86_64/$%{GAMESCOPE_VERSION}%\\n(Данный текст можно выделить и "
"скопировать)</b>"
msgid "" msgid ""
"<b>Gamescope is not detected on the system, please contact the manufacturer " "<b>Gamescope is not detected on the system, please contact the manufacturer "
"of your distribution\\nor search the Internet for information on how to " "of your distribution\\nor search the Internet for information on how to "
@ -1838,6 +1827,12 @@ msgstr "Отображать в часах и минутах"
msgid "Show in days, hours, minutes" msgid "Show in days, hours, minutes"
msgstr "Отображать в днях, часах и минутах" msgstr "Отображать в днях, часах и минутах"
msgid "According to last launch"
msgstr "По данным последнего запуска"
msgid "By time"
msgstr "По проведённому времени"
msgid "Recommended value" msgid "Recommended value"
msgstr "Рекомендуемое значение" msgstr "Рекомендуемое значение"
@ -1896,15 +1891,11 @@ msgstr "Отображение времени"
msgid "Displays time spent in an application or game" msgid "Displays time spent in an application or game"
msgstr "Отображает общее время проведённое в приложении или игре" msgstr "Отображает общее время проведённое в приложении или игре"
msgid "Sort shortcuts by time" msgid "Sort shortcuts by"
msgstr "Сортировка ярлыков по времени" msgstr "Сортировка ярлыков по"
msgid "" msgid "This setting sorts the shortcuts in the main menu"
"This setting sorts the shortcuts in the main menu depending on the time " msgstr "Эта настройка сортирует ярлыки в главном меню"
"spent in the application or game"
msgstr ""
"Эта настройка сортирует ярлыки в главном меню в зависимости от времени, "
"проведенного в приложении или игре"
msgid "GLOBAL SETTINGS (USER.CONF)" msgid "GLOBAL SETTINGS (USER.CONF)"
msgstr "ГЛОБАЛЬНЫЕ НАСТРОЙКИ (USER.CONF)" msgstr "ГЛОБАЛЬНЫЕ НАСТРОЙКИ (USER.CONF)"
@ -2066,17 +2057,6 @@ msgstr "НАЗАД"
msgid "SAVE" msgid "SAVE"
msgstr "СОХРАНИТЬ" msgstr "СОХРАНИТЬ"
#, sh-format
msgid ""
"PortProton v. ${install_ver}\n"
"scripts v. ${scripts_install_ver}"
msgstr ""
"PortProton v. ${install_ver}\n"
"версия v. ${scripts_install_ver}"
msgid "Copyright © $%DATE% Castro-Fidel (linux-gaming.ru)"
msgstr "Авторские права © $%DATE% Castro-Fidel (linux-gaming.ru)"
msgid "" msgid ""
"This program comes with absolutely no warranty.\n" "This program comes with absolutely no warranty.\n"
"See the License for details." "See the License for details."
@ -2181,6 +2161,28 @@ msgstr "Перезапускаем STEAM... Пожалуйста, подожди
msgid "Please wait. downloading covers for" msgid "Please wait. downloading covers for"
msgstr "Пожалуйста, подождите. Загрузка обложек для" msgstr "Пожалуйста, подождите. Загрузка обложек для"
#~ msgid ""
#~ "<b>Gamescope is not detected on the system, to install it, run the "
#~ "command in the terminal:\\nflatpak install -y runtime/org.freedesktop."
#~ "Platform.VulkanLayer.gamescope/x86_64/$%{GAMESCOPE_VERSION}%\\n(Can be "
#~ "selected and copied)</b>"
#~ msgstr ""
#~ "<b>Gamescope не найден в системе, для его установки выполните команду в "
#~ "терминале:\\nflatpak install -y runtime/org.freedesktop.Platform."
#~ "VulkanLayer.gamescope/x86_64/$%{GAMESCOPE_VERSION}%\\n(Данный текст можно "
#~ "выделить и скопировать)</b>"
#, sh-format
#~ msgid ""
#~ "PortProton v. ${install_ver}\n"
#~ "scripts v. ${scripts_install_ver}"
#~ msgstr ""
#~ "PortProton v. ${install_ver}\n"
#~ "версия v. ${scripts_install_ver}"
#~ msgid "Copyright © $%DATE% Castro-Fidel (linux-gaming.ru)"
#~ msgstr "Авторские права © $%DATE% Castro-Fidel (linux-gaming.ru)"
#~ msgid "WineD3D Vulkan (Damavand experimental)" #~ msgid "WineD3D Vulkan (Damavand experimental)"
#~ msgstr "WineD3D Vulkan (Damavand - экспериментальный)" #~ msgstr "WineD3D Vulkan (Damavand - экспериментальный)"

@ -1010,144 +1010,139 @@ search_desktop_file () {
fi fi
fi fi
done done
if [[ $DESKTOP_WITH_TIME == enabled ]] || [[ $SORT_WITH_TIME == enabled ]] ; then
while read -r -a line2 ; do while read -r -a line2 ; do
if [[ -z ${line2[0]} ]] \ if [[ -z ${line2[0]} ]] \
|| [[ ! ${line2[0],,} =~ .(bat|exe|msi|reg)$ ]] ; then || [[ ! ${line2[0],,} =~ .(bat|exe|msi|reg)$ ]] ; then
BROKEN_LINE=1 BROKEN_LINE=1
break break
fi
if [[ ${line2[1]} == "$FILE_SHA256SUM" ]] ; then
FILE_SHA256SUM_FOUND=1
break
fi
if [[ ${line2[1]} != "$FILE_SHA256SUM" ]] \
&& [[ ${line2[0]} == "${portwine_exe// /#@_@#}" ]] ; then
FILE_SHA256SUM_NOT_FOUND=1
break
fi
done < "$PORT_WINE_TMP_PATH/statistics"
local line3 line4 count_line i TIME_TOTAL SKIP_REPAIR
## Ремонты:
# Ремонт, проверяет чтобы длинна хеш суммы была равна 64 символам, в ином случае удалит битые
if [[ $FILE_SHA256SUM_NOT_FOUND == 1 ]] && [[ ${#line2[1]} != "64" ]] ; then
while read -r -a line3 ; do
if [[ ${#line3[1]} == "64" ]]
then echo "${line3[*]}"
fi fi
if [[ ${line2[1]} == "$FILE_SHA256SUM" ]] ; then done < "$PORT_WINE_TMP_PATH/statistics" > "$PORT_WINE_TMP_PATH/statistics_repair"
FILE_SHA256SUM_FOUND=1 try_remove_file "$PORT_WINE_TMP_PATH/statistics"
break mv -f "$PORT_WINE_TMP_PATH/statistics_repair" "$PORT_WINE_TMP_PATH/statistics"
fi return 1
if [[ ${line2[1]} != "$FILE_SHA256SUM" ]] \
&& [[ ${line2[0]} == "${portwine_exe// /#@_@#}" ]] ; then
FILE_SHA256SUM_NOT_FOUND=1
break
fi
done < "$PORT_WINE_TMP_PATH/statistics"
fi fi
if [[ $DESKTOP_WITH_TIME == enabled ]] || [[ $SORT_WITH_TIME == enabled ]] ; then
local line3 line4 count_line i TIME_TOTAL SKIP_REPAIR
## Ремонты:
# Ремонт, проверяет чтобы длинна хеш суммы была равна 64 символам, в ином случае удалит битые
if [[ $FILE_SHA256SUM_NOT_FOUND == 1 ]] && [[ ${#line2[1]} != "64" ]] ; then
while read -r -a line3 ; do
if [[ ${#line3[1]} == "64" ]]
then echo "${line3[*]}"
fi
done < "$PORT_WINE_TMP_PATH/statistics" > "$PORT_WINE_TMP_PATH/statistics_repair"
try_remove_file "$PORT_WINE_TMP_PATH/statistics"
mv -f "$PORT_WINE_TMP_PATH/statistics_repair" "$PORT_WINE_TMP_PATH/statistics"
return 1
fi
# Ремонт, если есть пустые строки и непонятные строки без .exe, .bat, .msi, .reg # Ремонт, если есть пустые строки и непонятные строки без .exe, .bat, .msi, .reg
if [[ $BROKEN_LINE == 1 ]] ; then if [[ $BROKEN_LINE == 1 ]] ; then
while read -r -a line4 ; do while read -r -a line4 ; do
if [[ -n ${line4[0]} ]] && [[ ${line4[0],,} =~ .(bat|exe|msi|reg)$ ]] if [[ -n ${line4[0]} ]] && [[ ${line4[0],,} =~ .(bat|exe|msi|reg)$ ]]
then echo "${line4[*]}" then echo "${line4[*]}"
fi
done < "$PORT_WINE_TMP_PATH/statistics" > "$PORT_WINE_TMP_PATH/statistics_repair"
try_remove_file "$PORT_WINE_TMP_PATH/statistics"
mv -f "$PORT_WINE_TMP_PATH/statistics_repair" "$PORT_WINE_TMP_PATH/statistics"
return 1
fi
# Ремонтирует путь на новый, если вдруг путь до .exe файла битый или изменился, но .exe файл он опознал
if [[ $FILE_SHA256SUM_FOUND == 1 ]] && [[ ${line2[0]} != "${portwine_exe// /#@_@#}" ]] ; then
sed -i "s|${line2[0]} ${line2[1]}|${portwine_exe// /#@_@#} ${line2[1]}|" "$PORT_WINE_TMP_PATH/statistics"
line2[0]=${portwine_exe// /#@_@#}
fi
# Ремонт, если sha256sum изменилась, но путь до .exe тот же
if [[ $FILE_SHA256SUM_NOT_FOUND == 1 ]] ; then
sed -i "s|${line2[0]} ${line2[1]}|${line2[0]} $FILE_SHA256SUM|" "$PORT_WINE_TMP_PATH/statistics"
line2[1]=$FILE_SHA256SUM
fi
# Когда приложения ещё нет в статистике
[[ -z ${line2[2]} ]] && line2[2]=0
# Ремонт, если сломалось время
if (( line2[2] >= 999999999 )) ; then
sed -i "s|${line2[1]} ${line2[2]}|${line2[1]} 0|" "$PORT_WINE_TMP_PATH/statistics"
line2[2]=0
fi
# Ремонт, если кто-то сломал время
if [[ ! ${line2[2]} =~ ^[0-9]+$ ]] ; then
sed -i "/${line2[1]}/d" "$PORT_WINE_TMP_PATH/statistics"
return 1
fi
###############################
# Общее проведённое время в секундах
export TIME_CURRENT=${line2[2]}
# количество запусков приложения
export COUNT_STARTS=${line2[4]//L4-/}
###############################
# Проверка новых десктоп файлов, чтобы их можно было сортировать первыми при первом создании в главном меню + ремонт
if [[ $PW_NEW_DESKTOP == 1 ]] && [[ ${line2[3]} != NEW_DESKTOP ]] ; then
if [[ $FILE_SHA256SUM_FOUND == 1 ]] ; then
sed -i "s|${line2[1]} \(.*\) ${line2[3]}|${line2[1]} \1 NEW_DESKTOP|" "$PORT_WINE_TMP_PATH/statistics"
else
echo "${portwine_exe// /#@_@#} $FILE_SHA256SUM $TIME_CURRENT NEW_DESKTOP" >> "$PORT_WINE_TMP_PATH/statistics"
fi fi
fi done < "$PORT_WINE_TMP_PATH/statistics" > "$PORT_WINE_TMP_PATH/statistics_repair"
unset PW_NEW_DESKTOP try_remove_file "$PORT_WINE_TMP_PATH/statistics"
mv -f "$PORT_WINE_TMP_PATH/statistics_repair" "$PORT_WINE_TMP_PATH/statistics"
return 1
fi
# Когда приложение было запущено и завершено # Ремонтирует путь на новый, если вдруг путь до .exe файла битый или изменился, но .exe файл он опознал
if [[ -n $PW_TIME_IN_GAME ]] ; then if [[ $FILE_SHA256SUM_FOUND == 1 ]] && [[ ${line2[0]} != "${portwine_exe// /#@_@#}" ]] ; then
TIME_TOTAL=$(( TIME_CURRENT + PW_TIME_IN_GAME )) sed -i "s|${line2[0]} ${line2[1]}|${portwine_exe// /#@_@#} ${line2[1]}|" "$PORT_WINE_TMP_PATH/statistics"
if [[ $FILE_SHA256SUM_FOUND == 1 ]] ; then line2[0]=${portwine_exe// /#@_@#}
# Когда есть предыдущее время fi
sed -i "s|$FILE_SHA256SUM $TIME_CURRENT|$FILE_SHA256SUM $TIME_TOTAL|" "$PORT_WINE_TMP_PATH/statistics"
# Ремонт, если sha256sum изменилась, но путь до .exe тот же
if [[ $FILE_SHA256SUM_NOT_FOUND == 1 ]] ; then
sed -i "s|${line2[0]} ${line2[1]}|${line2[0]} $FILE_SHA256SUM|" "$PORT_WINE_TMP_PATH/statistics"
line2[1]=$FILE_SHA256SUM
fi
# Когда приложения ещё нет в статистике
[[ -z ${line2[2]} ]] && line2[2]=0
# Ремонт, если сломалось время
if (( line2[2] >= 999999999 )) ; then
sed -i "s|${line2[1]} ${line2[2]}|${line2[1]} 0|" "$PORT_WINE_TMP_PATH/statistics"
line2[2]=0
fi
# Ремонт, если кто-то сломал время
if [[ ! ${line2[2]} =~ ^[0-9]+$ ]] ; then
sed -i "/${line2[1]}/d" "$PORT_WINE_TMP_PATH/statistics"
return 1
fi
###############################
# Общее проведённое время в секундах
export TIME_CURRENT=${line2[2]}
# количество запусков приложения
export COUNT_STARTS=${line2[4]//L4-/}
###############################
# Проверка новых десктоп файлов, чтобы их можно было сортировать первыми при первом создании в главном меню + ремонт
if [[ $PW_NEW_DESKTOP == 1 ]] && [[ ${line2[3]} != NEW_DESKTOP ]] ; then
if [[ $FILE_SHA256SUM_FOUND == 1 ]] ; then
sed -i "s|${line2[1]} \(.*\) ${line2[3]}|${line2[1]} \1 NEW_DESKTOP|" "$PORT_WINE_TMP_PATH/statistics"
else
echo "${portwine_exe// /#@_@#} $FILE_SHA256SUM $TIME_CURRENT NEW_DESKTOP" >> "$PORT_WINE_TMP_PATH/statistics"
fi
fi
unset PW_NEW_DESKTOP
# Когда приложение было запущено и завершено
if [[ -n $PW_TIME_IN_GAME ]] ; then
TIME_TOTAL=$(( TIME_CURRENT + PW_TIME_IN_GAME ))
if [[ $FILE_SHA256SUM_FOUND == 1 ]] ; then
# Когда есть предыдущее время
sed -i "s|$FILE_SHA256SUM $TIME_CURRENT|$FILE_SHA256SUM $TIME_TOTAL|" "$PORT_WINE_TMP_PATH/statistics"
else
# Когда только запустили приложение первый раз
echo "${portwine_exe// /#@_@#} $FILE_SHA256SUM $TIME_TOTAL OLD_DESKTOP" >> "$PORT_WINE_TMP_PATH/statistics"
fi
# Для ремонта если вдруг в линии ещё что-то есть
count_line=6
# Здесь добавляются новые линии для статистики (L4-) важен
if [[ -z ${line2[4]} ]] ; then
SKIP_REPAIR=1
sed -i "s|$FILE_SHA256SUM \(.*\)|$FILE_SHA256SUM \1 L4-1|" "$PORT_WINE_TMP_PATH/statistics"
else
# ремонт, если L4 по каким-то причинам сломался
if [[ ${line2[4]} =~ ^L4 ]] ; then
local NUMBER_OF_STARTS=$(( ${line2[4]//L4-/} + 1 ))
else else
# Когда только запустили приложение первый раз
echo "${portwine_exe// /#@_@#} $FILE_SHA256SUM $TIME_TOTAL OLD_DESKTOP" >> "$PORT_WINE_TMP_PATH/statistics"
fi
count_line=4
# Здесь добавляются новые линии для статистики (L4-) важен
if [[ -z ${line2[4]} ]] ; then
SKIP_REPAIR=1 SKIP_REPAIR=1
sed -i "s|$FILE_SHA256SUM \(.*\)|$FILE_SHA256SUM \1 L4-1|" "$PORT_WINE_TMP_PATH/statistics" sed -i "s|$FILE_SHA256SUM \(.*\) ${line2[4]}|$FILE_SHA256SUM \1 L4-1|" "$PORT_WINE_TMP_PATH/statistics"
else
# ремонт, если L4 по каким-то причинам сломался
if [[ ${line2[4]} =~ ^L4 ]] ; then
local NUMBER_OF_STARTS=$(( ${line2[4]//L4-/} + 1 ))
else
SKIP_REPAIR=1
sed -i "s|$FILE_SHA256SUM \(.*\) ${line2[4]}|$FILE_SHA256SUM \1 L4-1|" "$PORT_WINE_TMP_PATH/statistics"
fi
fi fi
(( count_line ++ )) fi
# Пример для L5 if [[ $SKIP_REPAIR != 1 ]] ; then
# if [[ -z ${line2[5]} ]] ; then # Ремонт, если количество элементов массива по каким-то причина больше, чем должно быть
# SKIP_REPAIR=1 if [[ -n ${line2["$count_line"]} ]] ; then
# sed -i "s|$FILE_SHA256SUM \(.*\)|$FILE_SHA256SUM \1 L5-1|" "$PORT_WINE_TMP_PATH/statistics" for i in $(seq $count_line ${#line2[@]}) ; do
# else unset 'line2[$i]'
# if [[ ${line2[5]} =~ ^L5 ]] ; then done
# local ЗДЕСЬ_НОВАЯ_ПЕРЕМЕННАЯ=$(( ${line2[5]//L5-/} + 1 )) sed -i "s|${portwine_exe// /#@_@#} $FILE_SHA256SUM \(.*\)|${line2[*]}|" "$PORT_WINE_TMP_PATH/statistics"
# else fi
# SKIP_REPAIR=1 # Для правильной работы L4
# sed -i "s|$FILE_SHA256SUM \(.*\) ${line2[5]}|$FILE_SHA256SUM \1 L5-1|" "$PORT_WINE_TMP_PATH/statistics" sed -i "s|$FILE_SHA256SUM \(.*\) ${line2[4]}|$FILE_SHA256SUM \1 L4-$NUMBER_OF_STARTS|" "$PORT_WINE_TMP_PATH/statistics"
# fi fi
# fi
# (( count_line ++ ))
if [[ $SKIP_REPAIR != 1 ]] ; then # Для правильной работы статистики по последнему запуску
# Ремонт, если количество элементов массива по каким-то причина больше, чем должно быть if [[ $SORT_WITH_TIME == "lastlaunch" ]] ; then
if [[ -n ${line2["$count_line"]} ]] ; then LAST_LAUNCH=$(grep -o 'L5-[0-9]\+' "$PORT_WINE_TMP_PATH/statistics" | sed 's/L5-//' | sort -nr | head -1)
for i in $(seq $count_line ${#line2[@]}) ; do [[ -z $LAST_LAUNCH ]] && LAST_LAUNCH=0
unset 'line2[$i]' LAST_LAUNCH=$(( LAST_LAUNCH + 1 ))
done if [[ -z ${line2[5]} ]] ; then
sed -i "s|${portwine_exe// /#@_@#} $FILE_SHA256SUM \(.*\)|${line2[*]}|" "$PORT_WINE_TMP_PATH/statistics" sed -i "s|$FILE_SHA256SUM \(.*\)|$FILE_SHA256SUM \1 L5-$LAST_LAUNCH|" "$PORT_WINE_TMP_PATH/statistics"
fi else
# Сюда все sedы от L4, L5 и т.д. (после всех ремонтов) sed -i "s|$FILE_SHA256SUM \(.*\) ${line2[5]}|$FILE_SHA256SUM \1 L5-$LAST_LAUNCH|" "$PORT_WINE_TMP_PATH/statistics"
sed -i "s|$FILE_SHA256SUM \(.*\) ${line2[4]}|$FILE_SHA256SUM \1 L4-$NUMBER_OF_STARTS|" "$PORT_WINE_TMP_PATH/statistics"
# sed -i "s|$FILE_SHA256SUM \(.*\) ${line2[5]}|$FILE_SHA256SUM \1 L5-$NUMBER_OF_STARTS|" "$PORT_WINE_TMP_PATH/statistics"
fi fi
fi fi
fi fi
@ -6032,12 +6027,12 @@ gui_userconf () {
DESKTOP_WITH_TIME="disabled" DESKTOP_WITH_TIME="disabled"
fi fi
if [[ -n "$SORT_WITH_TIME" ]] \ if [[ $SORT_WITH_TIME == "lastlaunch" ]] ; then
&& [[ "$SORT_WITH_TIME" == "disabled" ]] SORT_WITH_TIME=${translations[According to last launch]}
then elif [[ $SORT_WITH_TIME == "bytime" ]] ; then
SORT_WITH_TIME="disabled" SORT_WITH_TIME=${translations[By time]}
else else
SORT_WITH_TIME="enabled" SORT_WITH_TIME="disabled"
fi fi
if [[ $PW_WINE_DPI_VALUE == "recommended" ]] ; then if [[ $PW_WINE_DPI_VALUE == "recommended" ]] ; then
@ -6074,7 +6069,7 @@ gui_userconf () {
--field="${translations[Select PortProton theme]}!${translations[Allows you to select a theme for PortProton]} :CB" "$(combobox_fix "$GUI_THEME" "${translations[default]}!${translations[compact]}!${translations[classic]}")" \ --field="${translations[Select PortProton theme]}!${translations[Allows you to select a theme for PortProton]} :CB" "$(combobox_fix "$GUI_THEME" "${translations[default]}!${translations[compact]}!${translations[classic]}")" \
--field="${translations[Select gtk theme]}!${translations[Allows you to select a theme for GTK.]} :CB" "$(combobox_fix "$GTK_THEME" "${YAD_GTK_THEME}Adwaita:${translations[light]}!Adwaita:${translations[dark]}!${translations[default]}")" \ --field="${translations[Select gtk theme]}!${translations[Allows you to select a theme for GTK.]} :CB" "$(combobox_fix "$GTK_THEME" "${YAD_GTK_THEME}Adwaita:${translations[light]}!Adwaita:${translations[dark]}!${translations[default]}")" \
--field="${translations[Time display]}!${translations[Displays time spent in an application or game]} :CB" "$(combobox_fix --disabled "$DESKTOP_WITH_TIME" "${translations[Show in hours and minutes]}!${translations[Show in days, hours, minutes]}")" \ --field="${translations[Time display]}!${translations[Displays time spent in an application or game]} :CB" "$(combobox_fix --disabled "$DESKTOP_WITH_TIME" "${translations[Show in hours and minutes]}!${translations[Show in days, hours, minutes]}")" \
--field="${translations[Sort shortcuts by time]}!${translations[This setting sorts the shortcuts in the main menu depending on the time spent in the application or game]} :CB" "$(combobox_fix --disabled "$SORT_WITH_TIME" "enabled")" \ --field="${translations[Sort shortcuts by]}!${translations[This setting sorts the shortcuts in the main menu]} :CB" "$(combobox_fix --disabled "$SORT_WITH_TIME" "${translations[According to last launch]}!${translations[By time]}")" \
1> "${PW_TMPFS_PATH}/tmp_yad_userconf_set_cb" 2>/dev/null & 1> "${PW_TMPFS_PATH}/tmp_yad_userconf_set_cb" 2>/dev/null &
"${pw_yad}" --key=$KEY_USERCONF_GUI --paned --sensitive \ "${pw_yad}" --key=$KEY_USERCONF_GUI --paned --sensitive \
@ -6128,6 +6123,9 @@ gui_userconf () {
if [[ $DESKTOP_WITH_TIME == "${translations[Show in hours and minutes]}" ]] ; then DESKTOP_WITH_TIME="posnumber1" if [[ $DESKTOP_WITH_TIME == "${translations[Show in hours and minutes]}" ]] ; then DESKTOP_WITH_TIME="posnumber1"
elif [[ $DESKTOP_WITH_TIME == "${translations[Show in days, hours, minutes]}" ]] ; then DESKTOP_WITH_TIME="posnumber2" elif [[ $DESKTOP_WITH_TIME == "${translations[Show in days, hours, minutes]}" ]] ; then DESKTOP_WITH_TIME="posnumber2"
fi fi
if [[ $SORT_WITH_TIME == "${translations[According to last launch]}" ]] ; then SORT_WITH_TIME="lastlaunch"
elif [[ $SORT_WITH_TIME == "${translations[By time]}" ]] ; then SORT_WITH_TIME="bytime"
fi
edit_user_conf_from_gui PW_GPU_USE PW_WINE_DPI_VALUE PW_SOUND_DRIVER_USE GUI_THEME GTK_THEME DESKTOP_WITH_TIME SORT_WITH_TIME edit_user_conf_from_gui PW_GPU_USE PW_WINE_DPI_VALUE PW_SOUND_DRIVER_USE GUI_THEME GTK_THEME DESKTOP_WITH_TIME SORT_WITH_TIME
restart_pp restart_pp

@ -270,11 +270,21 @@ if [[ -z $DESKTOP_WITH_TIME ]] ; then
export DESKTOP_WITH_TIME="posnumber1" export DESKTOP_WITH_TIME="posnumber1"
fi fi
# TODO:fixes_after_update # SORT_WITH_TIME by default sorts from the last run
if [[ -z $SORT_WITH_TIME ]] ; then
echo 'export SORT_WITH_TIME="lastlaunch"' >> "$USER_CONF"
export SORT_WITH_TIME="lastlaunch"
fi
# TODO:fixes_after_update (со временем можно будет дропнуть)
if fixes_after_update "2395: DESKTOP_WITH_TIME by default displays hours and minutes" ; then if fixes_after_update "2395: DESKTOP_WITH_TIME by default displays hours and minutes" ; then
DESKTOP_WITH_TIME="posnumber1" DESKTOP_WITH_TIME="posnumber1"
edit_user_conf_from_gui DESKTOP_WITH_TIME edit_user_conf_from_gui DESKTOP_WITH_TIME
fi fi
if fixes_after_update "2398: SORT_WITH_TIME by default sorts from the last run" ; then
SORT_WITH_TIME="lastlaunch"
edit_user_conf_from_gui SORT_WITH_TIME
fi
# choose wine dpi default # choose wine dpi default
if [[ -z $PW_WINE_DPI_VALUE ]] ; then if [[ -z $PW_WINE_DPI_VALUE ]] ; then
@ -645,7 +655,7 @@ else
fi fi
unset PW_NAME_D_ICON PW_ICON_PATH PW_GAME_TIME PW_ALL_DF PW_AMOUNT_NEW_DESKTOP unset PW_NAME_D_ICON PW_ICON_PATH PW_GAME_TIME PW_ALL_DF PW_AMOUNT_NEW_DESKTOP
unset PW_DESKTOP_FILES_REGEX PW_AMOUNT_OLD_DESKTOP PW_DESKTOP_FILES unset PW_DESKTOP_FILES_REGEX PW_AMOUNT_OLD_DESKTOP PW_DESKTOP_FILES PW_LAST_LAUNCH
# Поиск .desktop файлов # Поиск .desktop файлов
AMOUNT_GENERATE_BUTTONS="0" AMOUNT_GENERATE_BUTTONS="0"
for desktop_file in "$PORT_WINE_PATH"/* ; do for desktop_file in "$PORT_WINE_PATH"/* ; do
@ -679,13 +689,17 @@ else
fi fi
while 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]} [[ $SORT_WITH_TIME == "bytime" ]] && PW_GAME_TIME["$AMOUNT_GENERATE_BUTTONS"]=${line2[2]}
if [[ $SORT_WITH_TIME == "lastlaunch" ]] ; then
[[ -n ${line2[5]} ]] && PW_LAST_LAUNCH["$AMOUNT_GENERATE_BUTTONS"]=${line2[5]//L5-/}
fi
break break
else else
PW_GAME_TIME["$AMOUNT_GENERATE_BUTTONS"]=0 [[ $SORT_WITH_TIME == "bytime" ]] && PW_GAME_TIME["$AMOUNT_GENERATE_BUTTONS"]=0
[[ $SORT_WITH_TIME == "lastlaunch" ]] && PW_LAST_LAUNCH["$AMOUNT_GENERATE_BUTTONS"]=0
fi fi
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 != "disabled" ]] && [[ ${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"
PW_AMOUNT_NEW_DESKTOP+=("$AMOUNT_GENERATE_BUTTONS") PW_AMOUNT_NEW_DESKTOP+=("$AMOUNT_GENERATE_BUTTONS")
else else
@ -696,7 +710,7 @@ else
fi fi
done done
# Переопределение элементов в массивах в зависимости от PW_GAME_TIME, от большего значения к меньшему. # Переопределение элементов в массивах в зависимости от PW_GAME_TIME, от большего значения к меньшему.
if [[ $SORT_WITH_TIME == enabled ]] && [[ -n ${PW_GAME_TIME[1]} ]] ; then if [[ $SORT_WITH_TIME == "bytime" ]] && [[ -n ${PW_GAME_TIME[1]} ]] ; then
for i in "${PW_AMOUNT_OLD_DESKTOP[@]}" ; do for i in "${PW_AMOUNT_OLD_DESKTOP[@]}" ; do
for j in "${PW_AMOUNT_OLD_DESKTOP[@]}" ; do for j in "${PW_AMOUNT_OLD_DESKTOP[@]}" ; do
if (( ${PW_GAME_TIME[$i]} > ${PW_GAME_TIME[$j]} )) ; then if (( ${PW_GAME_TIME[$i]} > ${PW_GAME_TIME[$j]} )) ; then
@ -718,6 +732,29 @@ else
done done
done done
fi fi
# Переопределение элементов в массивах в зависимости от того, какое приложение в последний раз использовалось
if [[ $SORT_WITH_TIME == "lastlaunch" ]] && [[ -n ${PW_LAST_LAUNCH[1]} ]] ; then
for i in "${PW_AMOUNT_OLD_DESKTOP[@]}" ; do
for j in "${PW_AMOUNT_OLD_DESKTOP[@]}" ; do
if (( ${PW_LAST_LAUNCH[$i]} > ${PW_LAST_LAUNCH[$j]} )) ; then
tmp_0=${PW_LAST_LAUNCH[$i]}
tmp_1=${PW_ALL_DF[$i]}
tmp_2=${PW_NAME_D_ICON[$i]}
tmp_4=${PW_ICON_PATH[$i]}
PW_LAST_LAUNCH[i]=${PW_LAST_LAUNCH[$j]}
PW_ALL_DF[i]=${PW_ALL_DF[$j]}
PW_NAME_D_ICON[i]=${PW_NAME_D_ICON[$j]}
PW_ICON_PATH[i]=${PW_ICON_PATH[$j]}
PW_LAST_LAUNCH[j]=$tmp_0
PW_ALL_DF[j]=$tmp_1
PW_NAME_D_ICON[j]=$tmp_2
PW_ICON_PATH[j]=$tmp_4
fi
done
done
fi
# Генерация .desktop баттанов для главного меню # Генерация .desktop баттанов для главного меню
IFS=$'\n' IFS=$'\n'
PW_GENERATE_BUTTONS="--field= ${translations[Create shortcut...]}!${PW_GUI_ICON_PATH}/find_48.svg!:FBTNR%@bash -c \"button_click --normal pw_find_exe\"%" PW_GENERATE_BUTTONS="--field= ${translations[Create shortcut...]}!${PW_GUI_ICON_PATH}/find_48.svg!:FBTNR%@bash -c \"button_click --normal pw_find_exe\"%"