updates for tray

This commit is contained in:
Htylol 2024-10-10 14:42:41 +05:00
parent 38e880d3af
commit 54f3bb08af
3 changed files with 15 additions and 29 deletions

@ -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
@ -1414,7 +1414,7 @@ pw_exit_tray () {
export -f pw_exit_tray export -f pw_exit_tray
stop_portwine () { stop_portwine () {
[[ "$int_xneur" == "1" ]] && xneur & [[ "$int_xneur" == "1" ]] && xneur &
if [[ "$PW_USE_US_LAYOUT" == "1" ]] \ if [[ "$PW_USE_US_LAYOUT" == "1" ]] \
&& ! check_wayland_session \ && ! check_wayland_session \
@ -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
@ -2733,7 +2728,7 @@ start_portwine () {
if check_gamescope_session ; then if check_gamescope_session ; then
export PW_GAMEMODERUN_SLR="" export PW_GAMEMODERUN_SLR=""
elif [[ "$PW_USE_GAMEMODE" = "1" ]] \ elif [[ "$PW_USE_GAMEMODE" = "1" ]] \
&& [[ -n "$DBUS_SESSION_BUS_ADDRESS" ]] && [[ -n "$DBUS_SESSION_BUS_ADDRESS" ]]
then then
if command -v gamemoded &>/dev/null ; then if command -v gamemoded &>/dev/null ; then
export GAMEMODERUN=1 export GAMEMODERUN=1
@ -3154,7 +3149,7 @@ start_portwine () {
if [[ -n "$CP_DXVK_FILES" ]] ; then if [[ -n "$CP_DXVK_FILES" ]] ; then
print_info "Try create symlink DXVK files..." print_info "Try create symlink DXVK files..."
for wine_dxvk_dll in $CP_DXVK_FILES ; do for wine_dxvk_dll in $CP_DXVK_FILES ; do
if [[ -f "${PATH_TO_DXVK_FILES}/x64/${wine_dxvk_dll}.dll" ]] ; then if [[ -f "${PATH_TO_DXVK_FILES}/x64/${wine_dxvk_dll}.dll" ]] ; then
try_force_link_file "${PATH_TO_DXVK_FILES}/x32/${wine_dxvk_dll}.dll" "${WINEPREFIX}/drive_c/windows/syswow64/${wine_dxvk_dll}.dll" try_force_link_file "${PATH_TO_DXVK_FILES}/x32/${wine_dxvk_dll}.dll" "${WINEPREFIX}/drive_c/windows/syswow64/${wine_dxvk_dll}.dll"
try_force_link_file "${PATH_TO_DXVK_FILES}/x64/${wine_dxvk_dll}.dll" "${WINEPREFIX}/drive_c/windows/system32/${wine_dxvk_dll}.dll" try_force_link_file "${PATH_TO_DXVK_FILES}/x64/${wine_dxvk_dll}.dll" "${WINEPREFIX}/drive_c/windows/system32/${wine_dxvk_dll}.dll"
var_winedlloverride_update "${wine_dxvk_dll}=n" var_winedlloverride_update "${wine_dxvk_dll}=n"
@ -4837,7 +4832,7 @@ gui_mangohud () {
export PW_MANGOHUD FPS_LIMIT export PW_MANGOHUD FPS_LIMIT
edit_db_from_gui MANGOHUD_CONFIG PW_MANGOHUD FPS_LIMIT edit_db_from_gui MANGOHUD_CONFIG PW_MANGOHUD FPS_LIMIT
if [[ "${YAD_MANGOHUD_STATUS}" == "184" ]] ; then if [[ "${YAD_MANGOHUD_STATUS}" == "184" ]] ; then
PW_MANGOHUD="1" PW_MANGOHUD="1"
pw_init_runtime pw_init_runtime
pw_mangohud_check pw_mangohud_check
@ -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 () {
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 () {
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"
[[ "$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
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