Commit f70ccc40 authored by Vladislav's avatar Vladislav

Update themes and scripts

parent f7a5e591
...@@ -776,10 +776,10 @@ debug_timer () { ...@@ -776,10 +776,10 @@ debug_timer () {
fi fi
} }
# Поиск нужного .desktop файла по $portwine_exe
search_desktop_file () { search_desktop_file () {
# Поиск нужного .desktop файла по $portwine_exe, чтобы внести изменения в него. for desktop_file in "$PORT_WINE_PATH"/* ; do
for desktop_file in "${PORT_WINE_PATH}"/* ; do 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 line ; do while IFS= read -r line ; do
...@@ -787,7 +787,7 @@ search_desktop_file () { ...@@ -787,7 +787,7 @@ search_desktop_file () {
if check_flatpak ; then if check_flatpak ; then
EXEC_DESKTOP=${line//Exec=flatpak run ru.linux_gaming.PortProton /} EXEC_DESKTOP=${line//Exec=flatpak run ru.linux_gaming.PortProton /}
else else
EXEC_DESKTOP=${line//Exec=env \"${PORT_SCRIPTS_PATH}\/start.sh\" /} EXEC_DESKTOP=${line//Exec=env \"$PORT_SCRIPTS_PATH\/start.sh\" /}
fi fi
EXEC_DESKTOP_NEW="${EXEC_DESKTOP//\"/}" EXEC_DESKTOP_NEW="${EXEC_DESKTOP//\"/}"
fi fi
...@@ -816,19 +816,17 @@ search_desktop_file () { ...@@ -816,19 +816,17 @@ search_desktop_file () {
IFS="$orig_IFS" IFS="$orig_IFS"
} }
# Конвертация секунд в дни, часы, минуты
seconds_to_time () { seconds_to_time () {
[[ -z $1 ]] && return 0 [[ -z $1 ]] && return 0
local seconds=$1 local seconds=$1
# Calculate days
local days=$((seconds / (60 * 60 * 24))) local days=$((seconds / (60 * 60 * 24)))
local seconds=$((seconds % (60 * 60 * 24))) local seconds=$((seconds % (60 * 60 * 24)))
# Calculate hours
local hours=$((seconds / (60 * 60))) local hours=$((seconds / (60 * 60)))
local seconds=$((seconds % (60 * 60))) local seconds=$((seconds % (60 * 60)))
# Calculate minutes
local minutes=$((seconds / 60)) local minutes=$((seconds / 60))
local seconds=$((seconds % 60)) local seconds=$((seconds % 60))
...@@ -889,27 +887,27 @@ combobox_fix () { ...@@ -889,27 +887,27 @@ combobox_fix () {
echo "disabled" echo "disabled"
return 0 return 0
fi fi
name1="$2" local name1="$2"
name2="$3" local name2="$3"
elif [[ "$1" == "--empty" ]] ; then elif [[ "$1" == "--empty" ]] ; then
if [[ -z "$3" ]] ; then if [[ -z "$3" ]] ; then
echo "" echo ""
return 0 return 0
fi fi
name1="$2" local name1="$2"
name2="$3" local name2="$3"
else else
name1="$1" local name1="$1"
if [[ -z "$2" ]] ; then if [[ -z "$2" ]] ; then
echo "${name1}" echo "${name1}"
return 0 return 0
fi fi
name2="$2" local name2="$2"
fi fi
name3="${name2//\!${name1}\!/\!}" local name3="${name2//\!${name1}\!/\!}"
name3="!${name3//${name1}\!/\!}" local name3="!${name3//${name1}\!/\!}"
name3="${name3//\!\!/\!}" local name3="${name3//\!\!/\!}"
name4="${name3//*\!/}" local name4="${name3//*\!/}"
if [[ ${name1} == "${name4}" ]] || [[ ${name1} == "\\${name4}" ]] if [[ ${name1} == "${name4}" ]] || [[ ${name1} == "\\${name4}" ]]
then name3="${name3%\!"${name1}"}" then name3="${name3%\!"${name1}"}"
fi fi
...@@ -5280,8 +5278,8 @@ gui_userconf () { ...@@ -5280,8 +5278,8 @@ gui_userconf () {
166) 166)
IFS='%' read -r -a PW_ADD_SETTINGS_UC <"${PW_TMPFS_PATH}/tmp_yad_userconf_set_cb" IFS='%' read -r -a PW_ADD_SETTINGS_UC <"${PW_TMPFS_PATH}/tmp_yad_userconf_set_cb"
IFS="$orig_IFS" IFS="$orig_IFS"
PW_GPU_USE=${PW_ADD_SETTINGS_UC[0]} PW_GPU_USE="${PW_ADD_SETTINGS_UC[0]}"
PW_SOUND_DRIVER_USE=${PW_ADD_SETTINGS_UC[1]} PW_SOUND_DRIVER_USE="${PW_ADD_SETTINGS_UC[1]}"
GUI_THEME="${PW_ADD_SETTINGS_UC[2]}" GUI_THEME="${PW_ADD_SETTINGS_UC[2]}"
DESKTOP_WITH_TIME="${PW_ADD_SETTINGS_UC[3]}" DESKTOP_WITH_TIME="${PW_ADD_SETTINGS_UC[3]}"
SORT_WITH_TIME="${PW_ADD_SETTINGS_UC[4]}" SORT_WITH_TIME="${PW_ADD_SETTINGS_UC[4]}"
......
...@@ -497,9 +497,7 @@ if [[ -f "${portwine_exe}" ]] ; then ...@@ -497,9 +497,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" PW_SHORTCUT="${translations[DELETE SHORTCUT]}!$PW_GUI_ICON_PATH/$BUTTON_SIZE.png!${translations[Delete shortcut for select file...]}:98"
fi fi
if [[ $DESKTOP_WITH_TIME == enabled ]] ; then [[ $DESKTOP_WITH_TIME == enabled ]] && search_desktop_file
search_desktop_file
fi
if [[ -z "${PW_COMMENT_DB}" ]] ; then if [[ -z "${PW_COMMENT_DB}" ]] ; then
if [[ -n "${PORTPROTON_NAME}" ]] ; then if [[ -n "${PORTPROTON_NAME}" ]] ; then
PW_COMMENT_DB="${translations[Launching]} <b>$(print_wrapped "${PORTPROTON_NAME}" "50")$(seconds_to_time "$TIME_CURRENT")</b>" PW_COMMENT_DB="${translations[Launching]} <b>$(print_wrapped "${PORTPROTON_NAME}" "50")$(seconds_to_time "$TIME_CURRENT")</b>"
...@@ -590,9 +588,7 @@ if [[ -f "${portwine_exe}" ]] ; then ...@@ -590,9 +588,7 @@ if [[ -f "${portwine_exe}" ]] ; then
fi fi
case $PW_YAD_SET in case $PW_YAD_SET in
128) 128)
if [[ "${PW_GUI_START}" == "NOTEBOOK" ]] ; then [[ "$PW_GUI_START" == "NOTEBOOK" ]] && unset PW_YAD_FORM_TAB
unset PW_YAD_FORM_TAB
fi
unset portwine_exe KEY_START $(sed -n '/export/p' "${PORTWINE_DB_FILE}" | sed 's/\(export\|=.*\| \)//g') unset portwine_exe KEY_START $(sed -n '/export/p' "${PORTWINE_DB_FILE}" | sed 's/\(export\|=.*\| \)//g')
print_info "Restarting..." print_info "Restarting..."
restart_pp restart_pp
...@@ -603,7 +599,7 @@ if [[ -f "${portwine_exe}" ]] ; then ...@@ -603,7 +599,7 @@ if [[ -f "${portwine_exe}" ]] ; then
esac esac
pw_yad_set_form pw_yad_set_form
pw_yad_form_vulkan pw_yad_form_vulkan
elif [[ -f "${PORTWINE_DB_FILE}" ]] ; then elif [[ -f "$PORTWINE_DB_FILE" ]] ; then
portwine_launch portwine_launch
fi fi
else else
...@@ -614,8 +610,8 @@ else ...@@ -614,8 +610,8 @@ else
# Поиск .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
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 line ; do while IFS= read -r line ; do
...@@ -623,7 +619,7 @@ else ...@@ -623,7 +619,7 @@ else
if check_flatpak ; then if check_flatpak ; then
PW_NAME_D_ICON["$AMOUNT_GENERATE_BUTTONS"]=${line//Exec=flatpak run ru.linux_gaming.PortProton /} PW_NAME_D_ICON["$AMOUNT_GENERATE_BUTTONS"]=${line//Exec=flatpak run ru.linux_gaming.PortProton /}
else else
PW_NAME_D_ICON["$AMOUNT_GENERATE_BUTTONS"]=${line//Exec=env \"${PORT_SCRIPTS_PATH}\/start.sh\" /} PW_NAME_D_ICON["$AMOUNT_GENERATE_BUTTONS"]=${line//Exec=env \"$PORT_SCRIPTS_PATH\/start.sh\" /}
fi fi
fi fi
if [[ $line =~ ^Icon= ]] ; then if [[ $line =~ ^Icon= ]] ; then
......
...@@ -23,7 +23,7 @@ export BUTTON_SIZE=32 # 24, 28, 32, 36, 40 ...@@ -23,7 +23,7 @@ export BUTTON_SIZE=32 # 24, 28, 32, 36, 40
export TAB_SIZE=32 # 24, 28, 32, 36, 40 export TAB_SIZE=32 # 24, 28, 32, 36, 40
export PW_MAIN_SIZE_W=500 export PW_MAIN_SIZE_W=1000
export PW_MAIN_SIZE_H=350 export PW_MAIN_SIZE_H=350
export PW_START_SIZE_W=500 export PW_START_SIZE_W=500
......
...@@ -31,7 +31,7 @@ export BUTTON_SIZE=28 # 24, 28, 32, 36, 40 ...@@ -31,7 +31,7 @@ export BUTTON_SIZE=28 # 24, 28, 32, 36, 40
export TAB_SIZE=32 # 24, 28, 32, 36, 40 export TAB_SIZE=32 # 24, 28, 32, 36, 40
# размер главного меню # размер главного меню
export PW_MAIN_SIZE_W=500 export PW_MAIN_SIZE_W=1000
export PW_MAIN_SIZE_H=330 export PW_MAIN_SIZE_H=330
# размер меню запуска и положения табов # размер меню запуска и положения табов
......
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