Commit 54f3bb08 authored by Vladislav's avatar Vladislav

updates for tray

parent 38e880d3
...@@ -785,7 +785,7 @@ search_desktop_file () { ...@@ -785,7 +785,7 @@ search_desktop_file () {
count=0 count=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
if [[ $line =~ ^Exec= ]] ; then if [[ $line =~ ^Exec= ]] ; then
...@@ -1448,20 +1448,15 @@ stop_portwine () { ...@@ -1448,20 +1448,15 @@ stop_portwine () {
pw_stop_progress_bar pw_stop_progress_bar
try_remove_file "${PORT_SCRIPTS_PATH}/0" try_remove_file "${PORT_SCRIPTS_PATH}/0"
try_remove_file "${PORT_SCRIPTS_PATH}/1" try_remove_file "${PORT_SCRIPTS_PATH}/1"
kill_portwine && kill_portwine
try_remove_dir "${PW_WINELIB}/var" try_remove_dir "${PW_WINELIB}/var"
find "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c/" -maxdepth 1 -type f -name "*.tmp" -delete find "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c/" -maxdepth 1 -type f -name "*.tmp" -delete
pw_exit_tray pw_exit_tray
pw_auto_create_shortcut pw_auto_create_shortcut
add_in_stop_portwine add_in_stop_portwine
# То что новый трей ругается на debug_timer и search_desktop_file, так и должно быть.
debug_timer --end -s "PW_TIME_IN_GAME" debug_timer --end -s "PW_TIME_IN_GAME"
# В году 31536000 секунд.
# Bash у меня ещё работает с таким числом 999999999999999999999999999999999999999999999999
PW_TIME_IN_GAME=$(( PW_TIME_IN_GAME / 1000 )) # в секундах PW_TIME_IN_GAME=$(( PW_TIME_IN_GAME / 1000 )) # в секундах
search_desktop_file search_desktop_file
case "$1" in case "$1" in
...@@ -5517,8 +5512,8 @@ portwine_create_shortcut () { ...@@ -5517,8 +5512,8 @@ portwine_create_shortcut () {
elif [[ "$PW_YAD_OUT" == "2" ]] ; then elif [[ "$PW_YAD_OUT" == "2" ]] ; then
print_info "Restarting PP..." print_info "Restarting PP..."
[[ -n $KEY_MENU ]] && unset portwine_exe [[ -n $KEY_MENU ]] && unset portwine_exe
[[ "${PW_GUI_START}" == "NOTEBOOK" ]] && unset PW_YAD_FORM_TAB [[ "$PW_GUI_START" == "NOTEBOOK" ]] && unset PW_YAD_FORM_TAB
restart_pp [[ -z $LINKS ]] && restart_pp
fi fi
} }
...@@ -5535,19 +5530,12 @@ pw_auto_create_shortcut () { ...@@ -5535,19 +5530,12 @@ pw_auto_create_shortcut () {
unset LINKS unset LINKS
for link_file in "${PORT_WINE_PATH}"/data/prefixes/*/drive_c/users/*/Desktop/*.lnk for link_file in "${PORT_WINE_PATH}"/data/prefixes/*/drive_c/users/*/Desktop/*.lnk
do do
if ! echo "$link_file" | grep "\*.lnk" &>/dev/null ; then
link_file=$(readlink -f "${link_file}") link_file=$(readlink -f "${link_file}")
LINKS+=("${link_file// /@_@}") LINKS+=(${link_file// /@_@})
else
continue
fi
done done
[[ -z "${LINKS[0]}" ]] && return 0 [[ -z "${LINKS[0]}" ]] && return 0
SORTED_LINKS=() read -r -a SORTED_LINKS < <(echo ${LINKS[@]} | tr ' ' '\n' | sort -u | tr '\n' ' ')
while IFS= read -r line ; do
SORTED_LINKS+=("$line")
done < <(echo ${LINKS[@]} | tr ' ' '\n' | sort -u)
IFS="$orig_IFS"
for link_file in "${SORTED_LINKS[@]//@_@/ }" ; do for link_file in "${SORTED_LINKS[@]//@_@/ }" ; do
if command -v exiftool &>/dev/null ; then if command -v exiftool &>/dev/null ; then
...@@ -5587,10 +5575,8 @@ pw_auto_create_shortcut () { ...@@ -5587,10 +5575,8 @@ pw_auto_create_shortcut () {
link_cmd=$(sed -n 's/^Command Line Arguments\s*:\s*//p' "${PW_TMPFS_PATH}/exiftool.tmp") link_cmd=$(sed -n 's/^Command Line Arguments\s*:\s*//p' "${PW_TMPFS_PATH}/exiftool.tmp")
fi fi
try_remove_file "$link_file"
if ! exe_path="$(realpath "${link_path}" 2>/dev/null)" ; then if ! exe_path="$(realpath "${link_path}" 2>/dev/null)" ; then
print_warning "Removed broken link for: $link_name" print_warning "Link broken for: $link_name"
else else
print_info "Created link for: $link_name" print_info "Created link for: $link_name"
PORTPROTON_NAME="$link_name" PORTPROTON_NAME="$link_name"
......
...@@ -326,7 +326,7 @@ export SKIP_CHECK_UPDATES="1" ...@@ -326,7 +326,7 @@ export SKIP_CHECK_UPDATES="1"
[[ "$MISSING_DESKTOP_FILE" == "1" ]] && portwine_missing_shortcut [[ "$MISSING_DESKTOP_FILE" == "1" ]] && portwine_missing_shortcut
if [[ $(basename "${portwine_exe}") =~ .ppack$ ]] ; then if [[ $(basename "${portwine_exe}") =~ .[Pp][Pp][Aa][Cc][Kk]$ ]] ; then
unset PW_SANDBOX_HOME_PATH unset PW_SANDBOX_HOME_PATH
pw_init_runtime pw_init_runtime
if check_flatpak if check_flatpak
...@@ -618,7 +618,7 @@ else ...@@ -618,7 +618,7 @@ else
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
if [[ $line =~ ^Exec= ]] ; then if [[ $line =~ ^Exec= ]] ; then
......
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