Commit 54f3bb08 authored by Vladislav's avatar Vladislav

updates for tray

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