Commit 9070d7ec authored by Mikhail Tergoev's avatar Mikhail Tergoev

Merge branch 'Htylol-added-lastlaunch' into devel

parents 7a2ecd1f 729a66b6
...@@ -7,13 +7,13 @@ ...@@ -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 "" ...@@ -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 "" ...@@ -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 "" ...@@ -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 "" ...@@ -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 "" ...@@ -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"
...@@ -1680,17 +1680,6 @@ msgid "Change settings gamescope for" ...@@ -1680,17 +1680,6 @@ msgid "Change settings gamescope for"
msgstr "Cambiar ajustes gamescope para" msgstr "Cambiar ajustes gamescope para"
msgid "" 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 ""
"<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 "
"install gamescope on your system.</b>" "install gamescope on your system.</b>"
...@@ -1850,6 +1839,13 @@ msgstr "" ...@@ -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" ...@@ -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" ...@@ -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." ...@@ -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 "" ...@@ -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"
...@@ -1669,17 +1669,6 @@ msgid "Change settings gamescope for" ...@@ -1669,17 +1669,6 @@ msgid "Change settings gamescope for"
msgstr "Изменить настройки Gamescope для" msgstr "Изменить настройки Gamescope для"
msgid "" 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 ""
"<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 "
"install gamescope on your system.</b>" "install gamescope on your system.</b>"
...@@ -1838,6 +1827,12 @@ msgstr "Отображать в часах и минутах" ...@@ -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 "Отображение времени" ...@@ -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 "НАЗАД" ...@@ -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... Пожалуйста, подожди ...@@ -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 () { ...@@ -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 fi
if [[ ${line2[1]} == "$FILE_SHA256SUM" ]] ; then if [[ ${line2[1]} == "$FILE_SHA256SUM" ]] ; then
FILE_SHA256SUM_FOUND=1 FILE_SHA256SUM_FOUND=1
break 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" ]] \ done < "$PORT_WINE_TMP_PATH/statistics" > "$PORT_WINE_TMP_PATH/statistics_repair"
&& [[ ${line2[0]} == "${portwine_exe// /#@_@#}" ]] ; then try_remove_file "$PORT_WINE_TMP_PATH/statistics"
FILE_SHA256SUM_NOT_FOUND=1 mv -f "$PORT_WINE_TMP_PATH/statistics_repair" "$PORT_WINE_TMP_PATH/statistics"
break return 1
fi
# Ремонт, если есть пустые строки и непонятные строки без .exe, .bat, .msi, .reg
if [[ $BROKEN_LINE == 1 ]] ; then
while read -r -a line4 ; do
if [[ -n ${line4[0]} ]] && [[ ${line4[0],,} =~ .(bat|exe|msi|reg)$ ]]
then echo "${line4[*]}"
fi fi
done < "$PORT_WINE_TMP_PATH/statistics" done < "$PORT_WINE_TMP_PATH/statistics" > "$PORT_WINE_TMP_PATH/statistics_repair"
fi try_remove_file "$PORT_WINE_TMP_PATH/statistics"
if [[ $DESKTOP_WITH_TIME == enabled ]] || [[ $SORT_WITH_TIME == enabled ]] ; then mv -f "$PORT_WINE_TMP_PATH/statistics_repair" "$PORT_WINE_TMP_PATH/statistics"
local line3 line4 count_line i TIME_TOTAL SKIP_REPAIR return 1
## Ремонты: fi
# Ремонт, проверяет чтобы длинна хеш суммы была равна 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 файла битый или изменился, но .exe файл он опознал
if [[ $BROKEN_LINE == 1 ]] ; then if [[ $FILE_SHA256SUM_FOUND == 1 ]] && [[ ${line2[0]} != "${portwine_exe// /#@_@#}" ]] ; then
while read -r -a line4 ; do sed -i "s|${line2[0]} ${line2[1]}|${portwine_exe// /#@_@#} ${line2[1]}|" "$PORT_WINE_TMP_PATH/statistics"
if [[ -n ${line4[0]} ]] && [[ ${line4[0],,} =~ .(bat|exe|msi|reg)$ ]] line2[0]=${portwine_exe// /#@_@#}
then echo "${line4[*]}" fi
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 файл он опознал # Ремонт, если sha256sum изменилась, но путь до .exe тот же
if [[ $FILE_SHA256SUM_FOUND == 1 ]] && [[ ${line2[0]} != "${portwine_exe// /#@_@#}" ]] ; then if [[ $FILE_SHA256SUM_NOT_FOUND == 1 ]] ; then
sed -i "s|${line2[0]} ${line2[1]}|${portwine_exe// /#@_@#} ${line2[1]}|" "$PORT_WINE_TMP_PATH/statistics" sed -i "s|${line2[0]} ${line2[1]}|${line2[0]} $FILE_SHA256SUM|" "$PORT_WINE_TMP_PATH/statistics"
line2[0]=${portwine_exe// /#@_@#} line2[1]=$FILE_SHA256SUM
fi fi
# Ремонт, если sha256sum изменилась, но путь до .exe тот же # Когда приложения ещё нет в статистике
if [[ $FILE_SHA256SUM_NOT_FOUND == 1 ]] ; then [[ -z ${line2[2]} ]] && line2[2]=0
sed -i "s|${line2[0]} ${line2[1]}|${line2[0]} $FILE_SHA256SUM|" "$PORT_WINE_TMP_PATH/statistics" # Ремонт, если сломалось время
line2[1]=$FILE_SHA256SUM if (( line2[2] >= 999999999 )) ; then
fi 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
# Когда приложения ещё нет в статистике ###############################
[[ -z ${line2[2]} ]] && line2[2]=0 # Общее проведённое время в секундах
# Ремонт, если сломалось время export TIME_CURRENT=${line2[2]}
if (( line2[2] >= 999999999 )) ; then # количество запусков приложения
sed -i "s|${line2[1]} ${line2[2]}|${line2[1]} 0|" "$PORT_WINE_TMP_PATH/statistics" export COUNT_STARTS=${line2[4]//L4-/}
line2[2]=0 ###############################
fi
# Ремонт, если кто-то сломал время
if [[ ! ${line2[2]} =~ ^[0-9]+$ ]] ; then
sed -i "/${line2[1]}/d" "$PORT_WINE_TMP_PATH/statistics"
return 1
fi
############################### # Проверка новых десктоп файлов, чтобы их можно было сортировать первыми при первом создании в главном меню + ремонт
# Общее проведённое время в секундах if [[ $PW_NEW_DESKTOP == 1 ]] && [[ ${line2[3]} != NEW_DESKTOP ]] ; then
export TIME_CURRENT=${line2[2]} if [[ $FILE_SHA256SUM_FOUND == 1 ]] ; then
# количество запусков приложения sed -i "s|${line2[1]} \(.*\) ${line2[3]}|${line2[1]} \1 NEW_DESKTOP|" "$PORT_WINE_TMP_PATH/statistics"
export COUNT_STARTS=${line2[4]//L4-/} else
############################### echo "${portwine_exe// /#@_@#} $FILE_SHA256SUM $TIME_CURRENT NEW_DESKTOP" >> "$PORT_WINE_TMP_PATH/statistics"
fi
fi
unset PW_NEW_DESKTOP
# Проверка новых десктоп файлов, чтобы их можно было сортировать первыми при первом создании в главном меню + ремонт # Когда приложение было запущено и завершено
if [[ $PW_NEW_DESKTOP == 1 ]] && [[ ${line2[3]} != NEW_DESKTOP ]] ; then if [[ -n $PW_TIME_IN_GAME ]] ; then
if [[ $FILE_SHA256SUM_FOUND == 1 ]] ; then TIME_TOTAL=$(( TIME_CURRENT + PW_TIME_IN_GAME ))
sed -i "s|${line2[1]} \(.*\) ${line2[3]}|${line2[1]} \1 NEW_DESKTOP|" "$PORT_WINE_TMP_PATH/statistics" 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_CURRENT NEW_DESKTOP" >> "$PORT_WINE_TMP_PATH/statistics" SKIP_REPAIR=1
sed -i "s|$FILE_SHA256SUM \(.*\) ${line2[4]}|$FILE_SHA256SUM \1 L4-1|" "$PORT_WINE_TMP_PATH/statistics"
fi fi
fi fi
unset PW_NEW_DESKTOP
# Когда приложение было запущено и завершено if [[ $SKIP_REPAIR != 1 ]] ; then
if [[ -n $PW_TIME_IN_GAME ]] ; then # Ремонт, если количество элементов массива по каким-то причина больше, чем должно быть
TIME_TOTAL=$(( TIME_CURRENT + PW_TIME_IN_GAME )) if [[ -n ${line2["$count_line"]} ]] ; then
if [[ $FILE_SHA256SUM_FOUND == 1 ]] ; then for i in $(seq $count_line ${#line2[@]}) ; do
# Когда есть предыдущее время unset 'line2[$i]'
sed -i "s|$FILE_SHA256SUM $TIME_CURRENT|$FILE_SHA256SUM $TIME_TOTAL|" "$PORT_WINE_TMP_PATH/statistics" done
else sed -i "s|${portwine_exe// /#@_@#} $FILE_SHA256SUM \(.*\)|${line2[*]}|" "$PORT_WINE_TMP_PATH/statistics"
# Когда только запустили приложение первый раз
echo "${portwine_exe// /#@_@#} $FILE_SHA256SUM $TIME_TOTAL OLD_DESKTOP" >> "$PORT_WINE_TMP_PATH/statistics"
fi fi
count_line=4 # Для правильной работы L4
# Здесь добавляются новые линии для статистики (L4-) важен sed -i "s|$FILE_SHA256SUM \(.*\) ${line2[4]}|$FILE_SHA256SUM \1 L4-$NUMBER_OF_STARTS|" "$PORT_WINE_TMP_PATH/statistics"
if [[ -z ${line2[4]} ]] ; then fi
SKIP_REPAIR=1
sed -i "s|$FILE_SHA256SUM \(.*\)|$FILE_SHA256SUM \1 L4-1|" "$PORT_WINE_TMP_PATH/statistics" # Для правильной работы статистики по последнему запуску
if [[ $SORT_WITH_TIME == "lastlaunch" ]] ; then
LAST_LAUNCH=$(grep -o 'L5-[0-9]\+' "$PORT_WINE_TMP_PATH/statistics" | sed 's/L5-//' | sort -nr | head -1)
[[ -z $LAST_LAUNCH ]] && LAST_LAUNCH=0
LAST_LAUNCH=$(( LAST_LAUNCH + 1 ))
if [[ -z ${line2[5]} ]] ; then
sed -i "s|$FILE_SHA256SUM \(.*\)|$FILE_SHA256SUM \1 L5-$LAST_LAUNCH|" "$PORT_WINE_TMP_PATH/statistics"
else else
# ремонт, если L4 по каким-то причинам сломался sed -i "s|$FILE_SHA256SUM \(.*\) ${line2[5]}|$FILE_SHA256SUM \1 L5-$LAST_LAUNCH|" "$PORT_WINE_TMP_PATH/statistics"
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
(( count_line ++ ))
# Пример для L5
# if [[ -z ${line2[5]} ]] ; then
# SKIP_REPAIR=1
# sed -i "s|$FILE_SHA256SUM \(.*\)|$FILE_SHA256SUM \1 L5-1|" "$PORT_WINE_TMP_PATH/statistics"
# else
# if [[ ${line2[5]} =~ ^L5 ]] ; then
# local ЗДЕСЬ_НОВАЯ_ПЕРЕМЕННАЯ=$(( ${line2[5]//L5-/} + 1 ))
# else
# SKIP_REPAIR=1
# sed -i "s|$FILE_SHA256SUM \(.*\) ${line2[5]}|$FILE_SHA256SUM \1 L5-1|" "$PORT_WINE_TMP_PATH/statistics"
# fi
# fi
# (( count_line ++ ))
if [[ $SKIP_REPAIR != 1 ]] ; then
# Ремонт, если количество элементов массива по каким-то причина больше, чем должно быть
if [[ -n ${line2["$count_line"]} ]] ; then
for i in $(seq $count_line ${#line2[@]}) ; do
unset 'line2[$i]'
done
sed -i "s|${portwine_exe// /#@_@#} $FILE_SHA256SUM \(.*\)|${line2[*]}|" "$PORT_WINE_TMP_PATH/statistics"
fi
# Сюда все sedы от L4, L5 и т.д. (после всех ремонтов)
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 () { ...@@ -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 () { ...@@ -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 () { ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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\"%"
......
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