From 8c91773a88e4b25cb064a94d0fc7d6a2c4fdd8b7 Mon Sep 17 00:00:00 2001 From: VHSgunzo Date: Sat, 24 Feb 2024 11:51:19 +0300 Subject: [PATCH] v0.78.2.9 (#22) --- CHANGELOG.md | 8 ++++ db/[EXE_NAMES].lwdb | 12 ++++++ lutris-wine | 2 +- lux-wine | 94 ++++++++++++++++++++++++++++++++++----------- lwrap/PKGBUILD | 2 +- lwrap/lwrap | 2 +- 6 files changed, 94 insertions(+), 26 deletions(-) create mode 100644 db/[EXE_NAMES].lwdb diff --git a/CHANGELOG.md b/CHANGELOG.md index 34fb831..1090963 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# v0.78.2.9 + +* Add `[EXE_NAMES].lwdb` DB script with custom EXE names +* Fix set `WINE_VERSION` from DB scripts for `System` Wine +* Fix wait for `lwrun` container processes exit +* Add check for duplicate exe arguments +* Minor fixes + # v0.78.2.8 * Add pseudo CD-ROM for fix old games CD-ROM check (`Road Rash` and others) diff --git a/db/[EXE_NAMES].lwdb b/db/[EXE_NAMES].lwdb new file mode 100644 index 0000000..1be9140 --- /dev/null +++ b/db/[EXE_NAMES].lwdb @@ -0,0 +1,12 @@ +case "${EXE_NAME,,}" in + *'league of legends'*) + EXE_LWDBFL="$LW_DB_DIR/LeagueClient.lwdb" ;; + gog_galaxy*) + EXE_LWDBFL="$LW_DB_DIR/setup.lwdb" ;; + wemod-*) + EXE_LWDBFL="$LW_DB_DIR/WeMod.lwdb" ;; + zonasetup*) + EXE_LWDBFL="$LW_DB_DIR/Zona.lwdb" ;; + 'direct commander setup'*) + EXE_LWDBFL="$LW_DB_DIR/Direct Commander.lwdb" ;; +esac diff --git a/lutris-wine b/lutris-wine index 6c8b003..0d0c630 100755 --- a/lutris-wine +++ b/lutris-wine @@ -1 +1 @@ -LW_VERSION="0.78.2.8" +LW_VERSION="0.78.2.9" diff --git a/lux-wine b/lux-wine index 0418b63..a19200e 100755 --- a/lux-wine +++ b/lux-wine @@ -1,6 +1,6 @@ #!/usr/bin/env bash -export LW_VERSION="0.78.2.8" +export LW_VERSION="0.78.2.9" export LW_DEVELOPERS="VHSgunzo" export RED='\033[1;91m' @@ -2188,14 +2188,16 @@ shrt_loop() { ) find_wpfxlnk() { find "$@" -type f -iname "*.lnk" 2>/dev/null|sort -u ; } find_wpfxurl() { find "$@" -type f -iname "*.url" 2>/dev/null|sort -u ; } - export pfxshrtname="$(basename "$WINEPREFIX")" - [ -f "/tmp/.lwshrt.$pfxshrtname" ] && \ + local pfxshrtname="$(basename "$WINEPREFIX")" + local lwshrt="$LW_DEF_TMP/lwshrt.$pfxshrtname" + [ -f "$lwshrt" ] && \ ! pidof wineserver &>/dev/null && \ - rm -f "/tmp/.lwshrt.$pfxshrtname" - if [ ! -f "/tmp/.lwshrt.$pfxshrtname" ] + rm -f "$lwshrt" + if [ ! -f "$lwshrt" ] then (IFS=$'\n' - touch "/tmp/.lwshrt.$pfxshrtname" + mkdir -p "$LW_DEF_TMP" + touch "$lwshrt" wait_wpids=100 while [ "$wait_wpids" -gt 0 ] && \ ! pidof wineserver &>/dev/null @@ -2220,7 +2222,7 @@ shrt_loop() { check_tray [ "$FORCE_TRAY" != 1 ] && \ check_shrt - done; rm -f "/tmp/.lwshrt.$pfxshrtname") + done; rm -f "$lwshrt") fi } @@ -2239,8 +2241,8 @@ lu_run() { echo_dbg|& tee -a "$LOG_FILE" ; "${LU_EXEC[@]}"|& tee -a "$LOG_FILE" } export -f exec_wine echo_dbg exec_with_log - shrt_loop & pre_launch 2>/dev/null + shrt_loop & dis_displ_sw 2>/dev/null lu_tray loadbar_cover 2>/dev/null @@ -2327,7 +2329,6 @@ lu_run() { fi fi wait - sleep 2 } lu_prestart() { @@ -2435,25 +2436,26 @@ check_db_script() { elif [ -f "$LW_PATH_LWDB" ] then export EXE_LWDBFL="$LW_PATH_LWDB" else - case "${EXE_NAME,,}" in - *'league of legends'*) export EXE_LWDBFL="$LW_DB_DIR/LeagueClient.lwdb" ;; - gog_galaxy*) export EXE_LWDBFL="$LW_DB_DIR/setup.lwdb" ;; - wemod-*) export EXE_LWDBFL="$LW_DB_DIR/WeMod.lwdb" ;; - zonasetup*) export EXE_LWDBFL="$LW_DB_DIR/Zona.lwdb" ;; - 'direct commander setup'*) export EXE_LWDBFL="$LW_DB_DIR/Direct Commander.lwdb" ;; - esac + local dbexes="$LW_DB_DIR/[EXE_NAMES].lwdb" + if [ -f "$dbexes" ] + then + set -a + source "$dbexes" + set +a + fi fi fi if [ -f "$EXE_LWDBFL" ] then print_info notify "Found EXE DB script!" print_info "Path: '$EXE_LWDBFL'" - local old_wine_version="$WINE_VERSION" + OLD_WINE_VERSION="$WINE_VERSION" set -a source "$EXE_LWDBFL" set +a - if [ "$old_wine_version" != "$WINE_VERSION" ] + if [ "$OLD_WINE_VERSION" != "$WINE_VERSION" ] then + NEW_WINE_VERSION="$WINE_VERSION" if [[ ! -d "$LW_WINE_DIR/$WINE_VERSION" && \ "$WINE_VERSION" != 'System' ]] then @@ -5939,6 +5941,16 @@ check_videodrv() { fi } +exe_args_add() { + if [ -n "$EXE_ARGS" ] + then + for arg in "$@" + do [[ "${EXE_ARGS[@]}" =~ "$arg" ]]||EXE_ARGS+=("$arg") + done + else EXE_ARGS=("$@") + fi +} + exeargs_parse() { sed_arg_quotes() { sed "s|^\"||;s|\"$||;s|^'||;s|'$||" ; } local char @@ -5965,19 +5977,19 @@ exeargs_parse() { elif [[ "$char" == ' ' ]] then char='' - EXE_ARGS+=("$(sed_arg_quotes<<<"$result")") + exe_args_add "$(sed_arg_quotes<<<"$result")" result='' fi fi result+="$char" done [ -n "$result" ] && \ - EXE_ARGS+=("$(sed_arg_quotes<<<"$result")") + exe_args_add "$(sed_arg_quotes<<<"$result")" } check_exe_args() { [ -n "$1" ] && \ - EXE_ARGS+=("$@") + exe_args_add "$@" [ -n "$EXEARGS" ] && \ exeargs_parse } @@ -6017,12 +6029,12 @@ export_all_functions() { check_reset_pulse export_all_functions check_win_version check_hold_terminal dll_manager check_dll_symlink try_ln check_git_release cleanrun \ runtime_manager upd_battleye is_exe_exist which_exe try_ln_wine_build_dll find_vk_icd btntls_run get_app_exe check_driprime greptardlurl get_wlu_releases \ upd_d3d_extras upd_dgvoodoo2 upd_dxvk upd_dxvk_nvapi upd_vkd3d upd_all is_loadbar lu_runapp lu_lsapp set_wine_version get_pge_releases get_wge_releases \ - check_wined3d check_vkbasalt_eff check_luwine_wcfg_cenv check_videodrv check_startfile check_def_config get_wk4_releases is_app_exist \ + check_wined3d check_vkbasalt_eff check_luwine_wcfg_cenv check_videodrv check_startfile check_def_config get_wk4_releases is_app_exist exe_args_add \ settingbar initbar check_network_status print_question print_input loadbar_cover check_first_run check_eac check_loadbar_cover installrun_nupkg_exe \ check_db_script stop_loadbar check_wmonover wmonover_upd check_exe_wcfg_cenv lu_appcfg try_fix_wrtx try_shutdown_wine check_steamapps is_winepfx \ check_display check_restore_resol resol_sw check_restore_gamma dis_displ_sw restore_resol check_virt_desktop check_vkbasalt_cfg check_exe_args \ check_wine_nvml check_resizable_bar check_latencyflex get_proton_d3dlib makesquash_zstd makesquash_xz lu_pfxbackup lu_pfxrestore lu_backupmnt lu_backupunmnt \ - check_dxvk_async check_vsync get_wine_git_lst try_dl_install_wine + check_dxvk_async check_vsync get_wine_git_lst try_dl_install_wine exeargs_parse } initbar() { @@ -6602,6 +6614,41 @@ if [[ "$EUID" == 0 && "$ALLOW_ROOT" != 1 ]] print_error yad "Don't run Lux Wine as root!" exit 1 else + (if [[ "$RUNSRC" =~ "lwrun" ]] + then + find_processes() { + processes="$(ls -l /proc/*/exe 2>/dev/null|grep ' ->')" + for ps in "${IGNPS[@]}" + do processes="$(grep -wv "$ps"<<<"$processes")" + done + } + [ -f "/tmp/.lwait.$RUNPID" ] && \ + ! kill -0 $RUNPID &>/dev/null && \ + rm -f "/tmp/.lwait.$RUNPID" + if [ ! -f "/tmp/.lwait.$RUNPID" ] + then + IGNPS=('sleep' 'gamemoded' 'bash' 'grep' 'tee' 'ls' 'shellsrv') + find_processes + wait_lwpids=100 + while [[ "$wait_lwpids" -gt 0 && \ + ! -n "$processes" ]] + do + wait_lwpids="$(( $wait_lwpids - 1 ))" + sleep 0.01 2>/dev/null + find_processes + done + touch "/tmp/.lwait.$RUNPID" + while [[ -n "$processes" && \ + -f "/tmp/.lwait.$RUNPID" ]] + do + sleep 0.5 + find_processes + done + rm -f "/tmp/.lwait.$RUNPID" + sleep 0.5 + fi + fi) & + lwait_pid=$! lite_init "$@" case $1 in -init) full_init "$@" ;; @@ -6641,3 +6688,4 @@ if [[ "$EUID" == 0 && "$ALLOW_ROOT" != 1 ]] *) lu_start "$@" ;; esac fi +wait "$lwait_pid" &>/dev/null diff --git a/lwrap/PKGBUILD b/lwrap/PKGBUILD index 5051e01..4613e0c 100644 --- a/lwrap/PKGBUILD +++ b/lwrap/PKGBUILD @@ -2,7 +2,7 @@ pkgname='lwrap' pkgver='0.78.2' -pkgrel='8' +pkgrel='9' pkgdesc='Lux Wine wrapper for RunImage container' arch=('x86_64') url='https://github.com/VHSgunzo/lux-wine' diff --git a/lwrap/lwrap b/lwrap/lwrap index ed203fa..adcf558 100755 --- a/lwrap/lwrap +++ b/lwrap/lwrap @@ -52,7 +52,7 @@ LWRAP_DIR='/opt/lwrap' LWRUNTIME="$LWRAP_DIR/runtime.tar.zst" HLWDIRLN="$HOME/LuxWine" OLD_HLWDIRLN="$HOME/LutrisWine" -LWRPIDFL='/tmp/.lwrpid' +LWRPIDFL="$XDG_RUNTIME_DIR/lwrpid" LWEXEC="$LWBIN_DIR/lwexec" HICOLOR_SIZES=( "512x512" "256x256" "192x192" "128x128"