From c5f4a8deb02c81d4f0e7ac98dbaef1ba5256b9c0 Mon Sep 17 00:00:00 2001 From: Htylol Date: Thu, 11 Jul 2024 18:21:18 +0500 Subject: [PATCH] added new pw_tray for support wayland session --- data_from_portwine/scripts/functions_helper | 30 +++++++++------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/data_from_portwine/scripts/functions_helper b/data_from_portwine/scripts/functions_helper index c1607e4..2d5255c 100755 --- a/data_from_portwine/scripts/functions_helper +++ b/data_from_portwine/scripts/functions_helper @@ -371,6 +371,7 @@ check_wayland_session () { return 1 fi } +export -f check_wayland_session check_flatpak () { if [[ ! -z "$FLATPAK_IN_USE" ]] @@ -924,8 +925,11 @@ stop_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 - if [[ ! -z "$(pgrep -a yad_gui_pp | grep "\--notification" | awk '{print $1}')" ]] ; then - kill -s SIGUSR1 "$(pgrep -a yad_gui_pp | grep "\--notification" | awk '{print $1}')" 2>/dev/null + if [[ ! -z "$(pgrep -a pw_tray)" ]] ; then + kill -s SIGUSR1 $(pgrep -a pw_tray) 2>/dev/null + fi + if [[ ! -z "$(pgrep -a yad_gui_pp)" ]] ; then + kill -s SIGUSR1 $(pgrep -a pw_yad_pp) 2>/dev/null fi add_in_stop_portwine unset SKIP_CHECK_UPDATES @@ -3125,15 +3129,10 @@ open_changelog () { export -f open_changelog pw_tray_icon () { - if [ ! -z "$(pgrep -a yad_gui_pp | grep "\--notification" | awk '{print $1}')" ] ; then - kill -s SIGUSR1 "$(pgrep -a yad_gui_pp | grep "\--notification" | awk '{print $1}')" + if [[ ! -z "$(pgrep -a pw_tray)" ]] ; then + kill -s SIGUSR1 $(pgrep -a pw_tray) 2>/dev/null fi - tray_icon_click () { - echo "" - } - export -f tray_icon_click - pw_tray_winefile () { pw_run winefile "C:\\users\\${USER}\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\" } @@ -3150,15 +3149,10 @@ pw_tray_icon () { } export -f tray_icon_click_exit - "${pw_yad}" --notification --no-middle \ - --image="$PW_GUI_ICON_PATH/portproton_tray_flatpak.svg" \ - --command="bash -c tray_icon_click" \ - --tooltip="PortProton" \ - --icon-size=32 --menu="| \ - $(gettext "WINEFILE")!bash -c pw_tray_winefile!"$PW_GUI_ICON_PATH/wine_file.svg"|| \ - $(gettext "TASKMGR")!bash -c pw_tray_taskmgr!"$PW_GUI_ICON_PATH/wine_system.svg"|| \ - $(gettext "CHANGELOG")!bash -c open_changelog!"$PW_GUI_ICON_PATH/history.svg"|| \ - $(gettext "FORCE EXIT") !bash -c tray_icon_click_exit!"$PW_GUI_ICON_PATH/close.svg"||" 2>/dev/null & + export PW_GUI_TRAY_PATH="${PW_GUI_THEMES_PATH}/tray" + cd ${PW_GUI_TRAY_PATH} + env LD_LIBRARY_PATH="${PW_GUI_TRAY_PATH}" "${PW_GUI_TRAY_PATH}/pw_tray" & + cd - return 0 }