diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e40254..7932831 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ +# v0.78.2.7 + +* Add app and EXE names to all DB scripts +* Update automatic shortcuts creation +* Fix manual shortcut creation from *.url file +* Fix manual shortcut removing for apps with a partial of the same name +* Fix passing arguments for EXE +* Fix launch GOG `Blade Runner` and other games with `ScummVM` +* Add DB script for `Syberia` +* Add DB script for `Infernal` +* Add DB script for `Abe's Oddysee` +* Add DB script for `upc.exe` from `Ubisoft Connect` +* Update DB script for `Crashday` +* Minor fixes + # v0.78.2.6 * Add DB script for `Caliber` diff --git a/db/ACOdyssey.lwdb b/db/ACOdyssey.lwdb index 9c2ee41..1e25d7b 100644 --- a/db/ACOdyssey.lwdb +++ b/db/ACOdyssey.lwdb @@ -1,3 +1,5 @@ +# Assassin's Creed Odyssey ('ACOdyssey.exe') + WIN_VER=10 GSTREAMER=0 WINEARCH=win64 diff --git a/db/AbeWin.lwdb b/db/AbeWin.lwdb new file mode 100644 index 0000000..824c241 --- /dev/null +++ b/db/AbeWin.lwdb @@ -0,0 +1,5 @@ +# Abe's Oddysee ('AbeWin.exe') + +pre_launch() { EXE_ARGS+=(-interline) ; } +WIN_VER=10 +DGVOODOO2=1 diff --git a/db/Anno1800.lwdb b/db/Anno1800.lwdb index f12a0b6..d8bae58 100644 --- a/db/Anno1800.lwdb +++ b/db/Anno1800.lwdb @@ -1 +1,3 @@ +# Anno 1800 ('Anno1800.exe') + LANG=en_US diff --git a/db/Anno2205.lwdb b/db/Anno2205.lwdb index 10a8865..1d22b7d 100644 --- a/db/Anno2205.lwdb +++ b/db/Anno2205.lwdb @@ -1 +1,3 @@ +# Anno 2205 ('Anno2205.exe') + PYTHONIOENCODING=utf-8 diff --git a/db/Arcania.lwdb b/db/Arcania.lwdb index d12b007..e732ce6 100644 --- a/db/Arcania.lwdb +++ b/db/Arcania.lwdb @@ -1,3 +1,5 @@ +# Gothic 4: Arcania - ('Arcania Addon.exe' 'ArcaniA Addon POL.exe' 'ArcaniA Addon RUS.exe' 'Arcania.exe') + WIN_VER=10 WINEARCH=win64 TZ=Europe/Moscow diff --git a/db/Battle.net Launcher.lwdb b/db/Battle.net Launcher.lwdb index cd48bcb..13aa9bd 120000 --- a/db/Battle.net Launcher.lwdb +++ b/db/Battle.net Launcher.lwdb @@ -1 +1 @@ -Battle.net-Setup.exe.lwdb \ No newline at end of file +Battle.net-Setup.lwdb \ No newline at end of file diff --git a/db/Battle.net-Setup.exe.lwdb b/db/Battle.net-Setup.exe.lwdb deleted file mode 100644 index 6a061a3..0000000 --- a/db/Battle.net-Setup.exe.lwdb +++ /dev/null @@ -1 +0,0 @@ -WINE_SIMULATE_WRITECOPY=1 diff --git a/db/Battle.net-Setup.lwdb b/db/Battle.net-Setup.lwdb new file mode 100644 index 0000000..34225d9 --- /dev/null +++ b/db/Battle.net-Setup.lwdb @@ -0,0 +1,3 @@ +# Battle.net Launcher ('Battle.net-Setup.exe' 'Battle.net Launcher.exe') + +WINE_SIMULATE_WRITECOPY=1 diff --git a/db/BioshockHD.lwdb b/db/BioshockHD.lwdb index 938bacb..b178755 100644 --- a/db/BioshockHD.lwdb +++ b/db/BioshockHD.lwdb @@ -1,3 +1,6 @@ +# BioShock Remastered ('BioshockHD.exe') +# Ubisoft Connect ('UbisoftConnect.exe' 'UbisoftConnectInstaller.exe' 'upc.exe') + WIN_VER=10 ESYNC=0 FSYNC=0 diff --git a/db/CaliberSetup.lwdb b/db/CaliberSetup.lwdb index 224b237..fc3d7d6 100644 --- a/db/CaliberSetup.lwdb +++ b/db/CaliberSetup.lwdb @@ -1,3 +1,5 @@ +# Caliber ('CaliberSetup.exe' 'Caliber.exe' 'CaliberStart.exe' 'launcher.exe') + WIN_VER=10 WINEARCH=win64 WINE_VERSION=System diff --git a/db/Crysis.lwdb b/db/Crysis.lwdb index 8ef22f4..904a1b5 100644 --- a/db/Crysis.lwdb +++ b/db/Crysis.lwdb @@ -1,2 +1,4 @@ +# Crysis ('Crysis.exe' 'Crysis64.exe' 'CrysisLauncher.exe') + WIN_VER=10 ESYNC=0 diff --git a/db/DOOMEternalx64vk.lwdb b/db/DOOMEternalx64vk.lwdb index aa644a5..951f2fa 100644 --- a/db/DOOMEternalx64vk.lwdb +++ b/db/DOOMEternalx64vk.lwdb @@ -1,3 +1,5 @@ -pre_launch() { check_exe_args '+com_skipIntroVideo 1 +com_skipKeyPressOnLoadScreens 1 +m_smoothing 0' ; } +# Doom Eternal ('DOOMEternalx64vk.exe') + +pre_launch() { EXE_ARGS+=(+com_skipIntroVideo 1 +com_skipKeyPressOnLoadScreens 1 +m_smoothing 0) ; } WIN_VER=10 diff --git a/db/Direct Commander.lwdb b/db/Direct Commander.lwdb index 3332f17..5ca35b0 100644 --- a/db/Direct Commander.lwdb +++ b/db/Direct Commander.lwdb @@ -1,3 +1,5 @@ +# Direct Commander ('Direct Commander.exe' 'Direct Commander Setup*.exe') + pre_launch() { if [[ "${EXE_NAME,,}" == 'direct commander setup'* ]] then diff --git a/db/EpicGamesLauncher.lwdb b/db/EpicGamesLauncher.lwdb index ed0970a..5515d72 100644 --- a/db/EpicGamesLauncher.lwdb +++ b/db/EpicGamesLauncher.lwdb @@ -1,3 +1,5 @@ -pre_launch() { check_exe_args '-opengl' ; } +# Epic Games Launcher ('EpicGamesLauncher.exe') + +pre_launch() { EXE_ARGS+=(-opengl) ; } WIN_VER=10 diff --git a/db/LeagueClient.lwdb b/db/LeagueClient.lwdb index 78a7008..4d79eb3 100644 --- a/db/LeagueClient.lwdb +++ b/db/LeagueClient.lwdb @@ -1,3 +1,5 @@ +# League of Legends ('live.na.exe' 'LeagueClient.exe' 'RiotClientServices.exe' '*league of legends*') + WIN_VER=10 DIS_NETCORE=1 WINEARCH=win64 @@ -7,7 +9,7 @@ USE_DEFPFX_BACKUP=1 MUST_HAVE_DLL=Disabled WINE_VERSION=wine-lutris-GE-Proton8-27-LoL-x86_64 [ "$EXE_NAME" == "RiotClientServices" ] && \ -EXE_ARG='--launch-product=league_of_legends --launch-patchline=live' +EXE_ARGS=(--launch-product=league_of_legends --launch-patchline=live) pfxsetupfl="$LW_DEF_WPFXS_DIR/$WPREFIX_NAME/.setup" if [ ! -f "$pfxsetupfl" ] diff --git a/db/MassEffect.lwdb b/db/MassEffect.lwdb index d6fc67b..31440d6 100644 --- a/db/MassEffect.lwdb +++ b/db/MassEffect.lwdb @@ -1,3 +1,5 @@ +# Mass Effect ('MassEffect.exe') + WIN_VER=10 WINEARCH=win64 RESTORE_RESOL=1 diff --git a/db/Porsche.lwdb b/db/Porsche.lwdb index c51e324..ed6515f 100644 --- a/db/Porsche.lwdb +++ b/db/Porsche.lwdb @@ -1,3 +1,6 @@ +# Need for Speed Porsche ('Porsche.exe') +# Emperor: Rise of the Middle Kingdom ('EMPEROR.exe') + WIN_VER=10 DGVOODOO2=1 WINEARCH=win64 diff --git a/db/Remnant2.lwdb b/db/Remnant2.lwdb index d79a3a7..ec3a8ad 100644 --- a/db/Remnant2.lwdb +++ b/db/Remnant2.lwdb @@ -1 +1,3 @@ +# Remnant 2 ('Remnant2.exe' 'Remnant2-Win64-Shipping.exe') + VKD3D_DISABLE_EXTENSIONS=VK_EXT_mesh_shader diff --git a/db/Sam4.lwdb b/db/Sam4.lwdb index 439047b..e7ca979 100644 --- a/db/Sam4.lwdb +++ b/db/Sam4.lwdb @@ -1,3 +1,5 @@ -pre_launch() { check_exe_args '+gfxapi D3D12 +sfxapi OpenAL' ; } +# Serious Sam 4 ('Sam4.exe') + +pre_launch() { EXE_ARGS+=(+gfxapi D3D12 +sfxapi OpenAL) ; } WIN_VER=10 diff --git a/db/SettlersHoK.lwdb b/db/SettlersHoK.lwdb index 395f765..1772036 100644 --- a/db/SettlersHoK.lwdb +++ b/db/SettlersHoK.lwdb @@ -1 +1,5 @@ +# Heritage of Kings - The Settlers ('SettlersHoK.exe') +# Command & Conquer: Red Alert 3 ('RA3.exe') +# Command & Conquer: Red Alert 3 — Uprising ('RA3EP1.exe') + FSR_MODE=Enabled diff --git a/db/SoF2.lwdb b/db/SoF2.lwdb index 4a0c3c1..d4f20fa 100644 --- a/db/SoF2.lwdb +++ b/db/SoF2.lwdb @@ -1,3 +1,5 @@ +# Soldier of Fortune 2 ('SoF2.exe') + SUM=($(sha256sum SoF2.exe 2>/dev/null)) PATCH_SUM='bf8225821e1b0e27ea97a7507034a575d93e3e190adbc9f162510bb547a52bbb' [ "$SUM" == "$PATCH_SUM" ] && \ diff --git a/db/Starfield.lwdb b/db/Starfield.lwdb index c793d24..0e4a1eb 100644 --- a/db/Starfield.lwdb +++ b/db/Starfield.lwdb @@ -1,2 +1,4 @@ +# Starfield ('Starfield.exe') + WIN_VER=10 DXR=0 diff --git a/db/Syberia.lwdb b/db/Syberia.lwdb new file mode 100644 index 0000000..8a41a91 --- /dev/null +++ b/db/Syberia.lwdb @@ -0,0 +1,11 @@ +# Syberia ('Syberia.exe') + +pre_launch() { + syberia_cfg="$EXE_PATH/player.ini" + [ ! -f "$syberia_cfg" ] && \ + echo "800 600 32 0 BaseCMO.cmo" > "$syberia_cfg" +} + +WIN_VER=10 +DGVOODOO2=1 + diff --git a/db/WeMod.lwdb b/db/WeMod.lwdb index 5a027dc..2984e8c 100644 --- a/db/WeMod.lwdb +++ b/db/WeMod.lwdb @@ -1,3 +1,5 @@ +# WeMod ('WeMod.exe' 'WeMod-*.exe') + pre_launch() { if [[ "${EXE_NAME,,}" == 'wemod-'[0-9]* ]] then diff --git a/db/Wolf2.lwdb b/db/Wolf2.lwdb index 5c9b6a9..8f997df 100644 --- a/db/Wolf2.lwdb +++ b/db/Wolf2.lwdb @@ -1,3 +1,5 @@ -pre_launch() { check_exe_args '+set com_skipIntro 1' ; } +# Wolfenstein (2009) ('Wolf2.exe') + +pre_launch() { EXE_ARGS+=(+set com_skipIntro 1) ; } WIN_VER=10 diff --git a/db/WorldOfSeaBattleClient.lwdb b/db/WorldOfSeaBattleClient.lwdb index da9f218..4234639 100644 --- a/db/WorldOfSeaBattleClient.lwdb +++ b/db/WorldOfSeaBattleClient.lwdb @@ -1,3 +1,5 @@ +# World Of Sea Battle ('WorldOfSeaBattleClient.exe' 'wos_client.exe') + WIN_VER=10 WINEARCH=win64 MUST_HAVE_DLL=Disabled diff --git a/db/Zona.lwdb b/db/Zona.lwdb index 95776d1..fdfdbdd 100644 --- a/db/Zona.lwdb +++ b/db/Zona.lwdb @@ -1,3 +1,5 @@ +# Zona ('Zona.exe' 'ZonaSetup*.exe') + WIN_VER=10 ZUPDATER="$WINEPREFIX/drive_c/users/steamuser/AppData/Roaming/Zona/plugins/zupdater" if [ -n "$(lspci|grep -o 'NVIDIA')" ] diff --git a/db/bms.lwdb b/db/bms.lwdb index 0fbc1bc..a92a4d5 100644 --- a/db/bms.lwdb +++ b/db/bms.lwdb @@ -1,4 +1,6 @@ +# Black Mesa ('bms.exe') + WIN_VER=10 pre_launch() { - check_exe_args "-oldgameui -w $(echo "$PRIMDISPL_RES"|cut -d'x' -f1) -h $(echo "$PRIMDISPL_RES"|cut -d'x' -f2)" + EXE_ARGS+=(-oldgameui -w $(echo "$PRIMDISPL_RES"|cut -d'x' -f1) -h $(echo "$PRIMDISPL_RES"|cut -d'x' -f2)) } diff --git a/db/crashday.lwdb b/db/crashday.lwdb index 9af9506..de8b565 100644 --- a/db/crashday.lwdb +++ b/db/crashday.lwdb @@ -1,5 +1,25 @@ +# Crashday ('crashday.exe') + +is_crashday_gcfg_fixed() { grep -qo '"FSAA": 0,' "$crashday_gcfg" 2>/dev/null ; } + pre_launch() { - crashday_gcfg="$WINEPREFIX/drive_c/users/steamuser/Local Settings/Crashday/config/graphics.config" - [ -f "$crashday_gcfg" ] && \ - sed -i 's|"FSAA": 2,|"FSAA": 0,|' "$crashday_gcfg" + if [ -f "$crashday_gcfg" ] && ! is_crashday_gcfg_fixed + then + sed -i 's|"FSAA": 2,|"FSAA": 0,|' "$crashday_gcfg" + sleep 0.5 + killall crashday.exe + return 0 + fi + return 1 } + +crashday_gcfg="$WINEPREFIX/drive_c/users/steamuser/Local Settings/Crashday/config/graphics.config" +if ! is_crashday_gcfg_fixed + then + (while kill -0 $LWPID + do + pre_launch && break + sleep 3 + done) & + post_launch() { sleep 0.5 ; cleanrun "$LW_SOURCE" "$LU_EXE" ; } +fi diff --git a/db/game.lwdb b/db/game.lwdb new file mode 100644 index 0000000..57c6c01 --- /dev/null +++ b/db/game.lwdb @@ -0,0 +1,24 @@ +# Infernal ('game.exe') + +infernal() { + WIN_VER=10 + WINEARCH=win64 + MUST_HAVE_DLL=physx + pre_launch() { + if [ ! -d "$WINEPREFIX/drive_c/Program Files (x86)/NVIDIA Corporation/PhysX/Engine/v2.5.2" ] + then + physexe="$LW_DEF_TMP/PhysX.v2.5.2.exe" + if [ -f "$physexe" ]||try_download "https://github.com/VHSgunzo/wine-dlls/releases/download/physx-v2.5.2/PhysX.v2.5.2.exe" "$LW_DEF_TMP" + then sleep 0.5 ; cleanrun "$LW_SOURCE" "$physexe" /VERYSILENT + else + try_rm "$physexe" &>/dev/null + print_error yad "Failed to download PhysX v2.5.2!" + exit 1 + fi + fi + } +} + +case "$EXE_DIR" in + 'Infernal') infernal ;; +esac diff --git a/db/launcher.lwdb b/db/launcher.lwdb index 6bc4659..2e1ff4f 100644 --- a/db/launcher.lwdb +++ b/db/launcher.lwdb @@ -1,3 +1,8 @@ +# Crossout ('launcher.exe') +# Dark Sector ('DS.exe' 'launcher.exe') +# Caliber ('CaliberSetup.exe' 'Caliber.exe' 'CaliberStart.exe' 'launcher.exe') +# Honkai: Star Rail ('launcher.exe') !'StarRail.exe' + srlauncher() { SR_PATCH_VER=v3.1.1 SR_PATCH_DIR="$LW_DEF_TMP/srpatch_$SR_PATCH_VER" diff --git a/db/nvapi64-tests.lwdb b/db/nvapi64-tests.lwdb index 035d685..423de95 100644 --- a/db/nvapi64-tests.lwdb +++ b/db/nvapi64-tests.lwdb @@ -1,3 +1,5 @@ +# nvapi64-tests ('nvapi64-tests.exe') + WIN_VER=10 TERMINAL=1 HOLD_TERMINAL=1 diff --git a/db/osu!.lwdb b/db/osu!.lwdb index 6b1d018..e5793e9 100644 --- a/db/osu!.lwdb +++ b/db/osu!.lwdb @@ -1,3 +1,5 @@ +# osu! ('osu!install.exe' 'osu!.exe') + WIN_VER=10 FPS_LIMIT=0 PULSE_LTCY=0 diff --git a/db/re8.lwdb b/db/re8.lwdb index 7c4474b..7e5e352 100644 --- a/db/re8.lwdb +++ b/db/re8.lwdb @@ -1,3 +1,5 @@ +# Resident Evil Village ('re8.exe') + pre_launch() { try_mkdir "$WINEPREFIX/drive_c/Program Files (x86)/Steam/userdata/418370/remote/win64_save" } diff --git a/db/setup.lwdb b/db/setup.lwdb index 4852e03..2cbb5cc 100644 --- a/db/setup.lwdb +++ b/db/setup.lwdb @@ -1,3 +1,7 @@ +# ('setup.exe') +# GOG Galaxy ('gog_galaxy*.exe') +# League of Legends ('live.na.exe' 'LeagueClient.exe' 'RiotClientServices.exe' '*league of legends*') + ESYNC=0 FSYNC=0 WIN_VER=10 diff --git a/db/speed.lwdb b/db/speed.lwdb index 0c0e89c..468d754 100644 --- a/db/speed.lwdb +++ b/db/speed.lwdb @@ -1,3 +1,9 @@ +# Need for Speed Most Wanted ('speed.exe') +# Need for Speed Carbon ('NFSC.exe') +# Need for Speed Underground ('speed.exe') +# Need for Speed Underground 2 ('SPEED2.exe') + + set_syswine() { WIN_VER=10 WINEARCH=win64 diff --git a/db/steam.lwdb b/db/steam.lwdb index e1f87c1..6190492 100644 --- a/db/steam.lwdb +++ b/db/steam.lwdb @@ -1,5 +1,7 @@ +# Steam ('Steam.exe') + pre_launch() { - check_exe_args "-no-cef-sandbox -opengl" + EXE_ARGS+=(-no-cef-sandbox -opengl) if [[ -f "$LW_REGPATCH_DIR/steam.reg" && \ ! -n "$(grep -A2 "\[Software.*Wine.*AppDefaults.*steam.exe\]" \ "$WINEPREFIX/user.reg"|grep -wo 'win10')" ]] diff --git a/db/upc.lwdb b/db/upc.lwdb new file mode 120000 index 0000000..4c6d53e --- /dev/null +++ b/db/upc.lwdb @@ -0,0 +1 @@ +BioshockHD.lwdb \ No newline at end of file diff --git a/db/wic.lwdb b/db/wic.lwdb index 5644985..df5ce27 100644 --- a/db/wic.lwdb +++ b/db/wic.lwdb @@ -1,3 +1,5 @@ +# World in Conflict ('wic.exe') + pre_launch() { wicconfig="$WINEPREFIX/drive_c/users/steamuser/Documents/World in Conflict/Game Options.txt" [ -f "$wicconfig" ] && \ diff --git a/db/xrEngine.lwdb b/db/xrEngine.lwdb index 60c05b0..6efbe10 100644 --- a/db/xrEngine.lwdb +++ b/db/xrEngine.lwdb @@ -1,3 +1,5 @@ +# S.T.A.L.K.E.R. ('xrEngine.exe') + pre_launch() { [[ ! -f "$EXE_PATH/fsgame.ltx" && \ -f "$EXE_PATH/../fsgame.ltx" ]] && \ diff --git a/lutris-wine b/lutris-wine index ddb3166..1b52dd7 100755 --- a/lutris-wine +++ b/lutris-wine @@ -1 +1 @@ -LW_VERSION="0.78.2.6" +LW_VERSION="0.78.2.7" diff --git a/lux-wine b/lux-wine index 0a87c83..353fe34 100755 --- a/lux-wine +++ b/lux-wine @@ -1,6 +1,6 @@ #!/usr/bin/env bash -export LW_VERSION="0.78.2.6" +export LW_VERSION="0.78.2.7" export LW_DEVELOPERS="VHSgunzo" export RED='\033[1;91m' @@ -1544,7 +1544,7 @@ create_shortcut() { if [ -n "$1" ] then SHRT_NAME="${ADD_APP_NAME//[^[:alnum:] ._-]/}" - SHRT_NAME="$(sed 's|^Запустить ||gi;s|^Играть ||gi;s|^Launch ||gi'<<<"$SHRT_NAME")" + SHRT_NAME="$(sed 's|^Запустить ||gi;s|^Играть ||gi;s|^Launch ||gi;s|^Play ||gi'<<<"$SHRT_NAME")" try_mkdir "$LW_DEF_TMP" DESKF="${LW_DEF_TMP}/${SHRT_NAME}.desktop" echo "[Desktop Entry]" > "$DESKF" @@ -1553,9 +1553,9 @@ create_shortcut() { SHRTEXEPATH="\"$1\""||\ SHRTEXEPATH="'$1'" shift - [ -n "$EXE_ARG" ] && \ - SHRTEXEARGS="$(echo "$EXE_ARG"|sed 's|"|\"|g')"||\ - SHRTEXEARGS="$(echo "$@"|sed 's|"|\"|g')" + [ -n "$EXE_ARGS" ] && \ + SHRTEXEARGS="$(echo "${EXE_ARGS[@]}"|sed 's|"|\"|g;s|\\|\\\\|g')"||\ + SHRTEXEARGS="$(echo "$@"|sed 's|"|\"|g;s|\\|\\\\|g')" echo "Name=$SHRT_NAME" >> "$DESKF" [ -n "$SHRTEXEARGS" ] && \ echo "Exec='$LW_SOURCE' $SHRTEXEPATH $SHRTEXEARGS" >> "$DESKF"||\ @@ -1584,12 +1584,12 @@ create_shortcut() { echo "Name=DEBUG" >> "$DESKF" echo "Name[ru_RU]=ДЕБАГ" >> "$DESKF" echo "Icon="$SHRT_ICON"" >> "$DESKF" - echo "Exec='$LW_SOURCE' -debug $SHRTEXEPATH" >> "$DESKF" + echo "Exec='$LW_SOURCE' -debug $SHRTEXEPATH $SHRTEXEARGS" >> "$DESKF" echo -e "\n[Desktop Action cmd]" >> "$DESKF" echo "Name=Open in CMD" >> "$DESKF" echo "Name[ru_RU]=Открыть в CMD" >> "$DESKF" echo "Icon="$SHRT_ICON"" >> "$DESKF" - echo "Exec='$LW_SOURCE' -cmd $SHRTEXEPATH" >> "$DESKF" + echo "Exec='$LW_SOURCE' -cmd $SHRTEXEPATH $SHRTEXEARGS" >> "$DESKF" echo -e "\n[Desktop Action explorer]" >> "$DESKF" echo "Name=Explorer" >> "$DESKF" echo "Name[ru_RU]=Рабочий стол" >> "$DESKF" @@ -1693,7 +1693,7 @@ lu_debug() { check_ld_library export PRINT_VARS="$(print_var "WINE_VERSION" "WINEDIR" "WINE" "WINEARCH" "WINEPREFIX" "WIN_VER" "WINEDLLOVERRIDES" "CHK_UPDATE" "NVPRIME" \ "VKBASALT_EFFECTS" "WINE_MONO_OVERRIDES" "EXE_PATH" "LU_EXE" "VKD3D_CONFIG" "LD_LIBRARY_PATH" "PATH" "WINEDEBUG" "CPU_LIMIT" "VSYNC" \ - "VKD3D_DEBUG" "WINE_MONO_TRACE" "VKBASALT_LOG_LEVEL" "DXVK_LOG_LEVEL" "EXE_ARG" "PULSE_LATENCY_MSEC" "VIRTUAL_DESKTOP" "FPS_LIMIT" "LW_CENV" \ + "VKD3D_DEBUG" "WINE_MONO_TRACE" "VKBASALT_LOG_LEVEL" "DXVK_LOG_LEVEL" "EXE_ARGS" "PULSE_LATENCY_MSEC" "VIRTUAL_DESKTOP" "FPS_LIMIT" "LW_CENV" \ "LW_DIR" "LW_CFG" "GSTREAMER" "HIDE_NVIDIA_GPU" "EXE_LWDB" "EXE_LWDBFL" "GST_PLUGIN_SYSTEM_PATH_1_0" "WINE_GST_REGISTRY_DIR" "RUNSRC" "RUNROOTFS_VERSION" \ "WINE_SANDBOX" "WINEFSYNC" "WINEFSYNC_FUTEX2" "WINE_FULLSCREEN_FSR" "WINE_FULLSCREEN_FSR_STRENGTH" "STAGING_SHARED_MEMORY" "WINEESYNC" "VKBASALT_LOG_FILE" \ "LOG_FILE" "WINE_LARGE_ADDRESS_AWARE" "TERM_APP" "VKBASALT" "DXVK_NVAPIHACK" "MANGOHUD" "MANGOHUD_USER_CONF" "RUN_GAMEMODE" "VKD3D_LOG_FILE" \ @@ -2162,11 +2162,11 @@ check_shrt() ( IFS=$'\n' LW_APPS_EXES=($(grep -Eiom1 " [\"']/.*\.exe| [\"']/.*\.bat" -r \ "$LW_APPS_DIR" 2>/dev/null|sed "s|.*\.desktop: ['\"]||g")) - if [ -n "${LW_APPS_EXES[*]}" ] + if [ -n "$LW_APPS_EXES" ] then for exe in "${LW_APPS_EXES[@]}" do [ ! -f "$(ipath "$exe"|head -1)" ] && \ - NO_YAD=1 lu_rmapp "$exe" + NO_YAD=1 RM_ALL_EXE_APPS=1 lu_rmapp "$exe" done fi ) @@ -2205,11 +2205,11 @@ shrt_loop() { sleep 1 2>/dev/null WPREFIXLNK=($(find_wpfxlnk "${WPFXDESKDIRS[@]}")) WPREFIXLNK+=($(find_wpfxlnk "${WPFXMENUDIRS[@]}")) - unset LU_EXE EXE_ARG + unset LU_EXE EXE_ARGS shrt_from_lnk "${WPREFIXLNK[@]}" WPREFIXURL=($(find_wpfxurl "${WPFXDESKDIRS[@]}")) WPREFIXURL+=($(find_wpfxurl "${WPFXMENUDIRS[@]}")) - unset LU_EXE EXE_ARG + unset LU_EXE EXE_ARGS shrt_from_url "${WPREFIXURL[@]}" check_tray [ "$FORCE_TRAY" != 1 ] && \ @@ -2219,6 +2219,20 @@ shrt_loop() { } lu_run() { + LU_EXEC=("$@") + echo_dbg() { echo -e "$(cat "$TMP_DBG" 2>/dev/null)\n$PRINT_VARS" ; } + exec_wine() { + [[ "$E_LU_EXEC" =~ ^declare ]] && eval "$E_LU_EXEC" + [[ "$E_EXE_ARGS" =~ ^declare ]] && eval "$E_EXE_ARGS" + [[ "$E_EXE_WRAPPER" =~ ^declare ]] && eval "$E_EXE_WRAPPER" + $RUN_VKCAPTURE $RUN_FPSLIMIT $RUN_GAMEMODE $RUN_MANGOHUD $RUN_CPU_LIMIT \ + "$WINE" $RUN_VDESKTOP "${EXE_WRAPPER[@]}" "${LU_EXEC[@]}" "${EXE_ARGS[@]}" + } + exec_with_log() { + [[ "$E_LU_EXEC" =~ ^declare ]] && eval "$E_LU_EXEC" + 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 dis_displ_sw 2>/dev/null @@ -2228,31 +2242,33 @@ lu_run() { lu_debug 2>/dev/null compositor_sw 2>/dev/null check_ld_library + [[ -n "$LU_EXEC" ]] && export E_LU_EXEC="$(declare -p LU_EXEC)" + [[ -n "$EXE_ARGS" ]] && export E_EXE_ARGS="$(declare -p EXE_ARGS)" + [[ -n "$EXE_WRAPPER" ]] && export E_EXE_WRAPPER="$(declare -p EXE_WRAPPER)" if [[ "$LOG" == 1 && "$TERMINAL" == 1 ]] then if [ -n "$LU_SHELL_EXE" ] then unset LU_SHELL_PTH TERMINAL LU_SHELL_EXE LD_LIBRARY_PATH - $TERM_APP $LWSHELL -c "echo -en '$(cat "$TMP_DBG" 2>/dev/null)\n$PRINT_VARS\n\n'|& tee -a '$LOG_FILE' ; '$@'|& tee -a '$LOG_FILE'" + $TERM_APP $LWSHELL -c 'exec_with_log' clear_log 2>/dev/null $LW_EDITOR "$LOG_FILE" 2>/dev/null & elif [ -n "$LU_SHELL_PTH" ] then unset LU_SHELL_PTH TERMINAL LD_LIBRARY_PATH if [ -n "$1" ] - then $TERM_APP "$@" + then $TERM_APP "${LU_EXEC[@]}" else $TERM_APP $LWSHELL fi else - $TERM_APP $LWSHELL -c "echo -en '$(cat "$TMP_DBG" 2>/dev/null)\n$PRINT_VARS\n\n'|& tee -a '$LOG_FILE' ; \ - $RUN_VKCAPTURE $RUN_FPSLIMIT $RUN_GAMEMODE $RUN_MANGOHUD $RUN_CPU_LIMIT '$WINE' $RUN_VDESKTOP '$@' $EXE_ARG|& tee -a '$LOG_FILE'" + $TERM_APP $LWSHELL -c "echo_dbg|& tee -a '$LOG_FILE' ; exec_wine|& tee -a '$LOG_FILE'" clear_log 2>/dev/null $LW_EDITOR "$LOG_FILE" 2>/dev/null & fi elif [ "$LOG" == 1 ] then - echo -en "$(cat "$TMP_DBG" 2>/dev/null)\n$PRINT_VARS\n" - $RUN_VKCAPTURE $RUN_FPSLIMIT $RUN_GAMEMODE $RUN_MANGOHUD $RUN_CPU_LIMIT "$WINE" $RUN_VDESKTOP "${EXE_WRAPPER[@]}" "$@" $EXE_ARG|& tee -a "$LOG_FILE" + echo_dbg + exec_wine|& tee -a "$LOG_FILE" clear_log 2>/dev/null $LW_EDITOR "$LOG_FILE" 2>/dev/null & elif [ "$TERMINAL" == 1 ] @@ -2262,12 +2278,12 @@ lu_run() { if [ "$LOG" == 1 ] then unset LU_SHELL_EXE TERMINAL - $TERM_APP $LWSHELL -c "echo -en '$(cat "$TMP_DBG" 2>/dev/null)\n$PRINT_VARS\n\n'|& tee -a '$LOG_FILE' ; '$@'|& tee -a '$LOG_FILE'" + $TERM_APP $LWSHELL -c 'exec_with_log' clear_log 2>/dev/null $LW_EDITOR "$LOG_FILE" 2>/dev/null & else unset LU_SHELL_EXE TERMINAL - $TERM_APP $LWSHELL -c "$@" + $TERM_APP $LWSHELL -c "${LU_EXEC[@]}" fi elif [ -n "$LU_SHELL_PTH" ] then @@ -2277,16 +2293,14 @@ lu_run() { if [ "$LU_LNK" == 1 ] then export TMP_OUT="/tmp/${WINE_VERSION}_$(date +'%Y-%m-%d_%H%M%S').out" - $TERM_APP $LWSHELL -c "echo -en '$(cat "$TMP_DBG" 2>/dev/null)\n$PRINT_VARS\n' ; \ - $RUN_VKCAPTURE $RUN_FPSLIMIT $RUN_GAMEMODE $RUN_MANGOHUD $RUN_CPU_LIMIT '$WINE' $RUN_VDESKTOP '$@' $EXE_ARG|& tee -a '$TMP_OUT'" + $TERM_APP $LWSHELL -c "echo_dbg ; exec_wine|& tee -a '$TMP_OUT'" else - $TERM_APP $LWSHELL -c "echo -en '$(cat "$TMP_DBG" 2>/dev/null)\n$PRINT_VARS\n' ; \ - $RUN_VKCAPTURE $RUN_FPSLIMIT $RUN_GAMEMODE $RUN_MANGOHUD $RUN_CPU_LIMIT '$WINE' $RUN_VDESKTOP '$@' $EXE_ARG" + $TERM_APP $LWSHELL -c 'echo_dbg ; exec_wine' fi fi else - echo -en "$(cat "$TMP_DBG" 2>/dev/null)\n$PRINT_VARS\n" - $RUN_VKCAPTURE $RUN_FPSLIMIT $RUN_GAMEMODE $RUN_MANGOHUD $RUN_CPU_LIMIT "$WINE" $RUN_VDESKTOP "${EXE_WRAPPER[@]}" "$@" $EXE_ARG + echo_dbg + exec_wine fi export LD_LIBRARY_PATH="$SYS_LDLIBPTH" post_launch 2>/dev/null @@ -2340,17 +2354,17 @@ check_startfile() { ipath_pth="$(ipath "$1"|head -1)" [[ -n "$(basename "$1"|grep -io "\.lwpfx$")" \ && ! -n "$LU_LWPFX" ]] && export LU_LWPFX="$(readlink -f "$ipath_pth")" - [ ! -n "$EXE_ARG" ] && export EXE_ARG="${*:2}" - [ ! -n "$FULLCMDLINE" ] && export FULLCMDLINE="$0 '${*:1}'" + [ ! -n "$EXE_ARGS" ] && export EXE_ARGS=("${@:2}") + [ ! -n "$FULLCMDLINE" ] && export FULLCMDLINE=("$0" "${@:1}") elif [ -f "$(ipath "$2"|head -1)" ] then ipath_pth="$(ipath "$2"|head -1)" [[ -n "$(basename "$2"|grep -io "\.lwpfx$")" \ && ! -n "$LU_LWPFX" ]] && export LU_LWPFX="$(readlink -f "$ipath_pth")" - [ ! -n "$EXE_ARG" ] && export EXE_ARG="${*:3}" - [ ! -n "$FULLCMDLINE" ] && export FULLCMDLINE="$0 $1 '${*:2}'" + [ ! -n "$EXE_ARGS" ] && export EXE_ARGS=("${@:3}") + [ ! -n "$FULLCMDLINE" ] && export FULLCMDLINE=("$0" "$1" "${@:2}") else - [ ! -n "$FULLCMDLINE" ] && export FULLCMDLINE="$0 $1" + [ ! -n "$FULLCMDLINE" ] && export FULLCMDLINE=("$0" "$1") fi [ ! -n "$LU_START" ] && export LU_START="$ipath_pth" case "$LU_START" in @@ -2624,6 +2638,7 @@ check_latencyflex() { } lite_init() { + unset EXE_ARGS DEPRECATE_INIT=("-killwine" "-killtray" "-killexe" "-killshell" "-exit" "-tray" "-lsapp" "-runapp") export_all_functions if ! [[ "${DEPRECATE_INIT[@]}" =~ "$1" ]] || [ ! -n "$1" ] @@ -2805,9 +2820,8 @@ lu_config() { VSYNC LWVKCAPTURE NVPRIME DRIPRIME" WCFGOUT="$(while read CFGVAR <&3 && read CFGPARAM <&4 do - if [ -n "$(echo "$CFGPARAM"|sed "s/''//")" ] - then echo "$CFGVAR=$CFGPARAM" - fi + [ -n "$(echo "$CFGPARAM"|sed "s|''||")" ] && \ + echo "$CFGVAR=$CFGPARAM" done 3< <(echo "$LWCFGVAR"|tr ' ' '\n'|sedspaces) \ 4< <(echo -e "$(cat "/tmp/winesett$LWCFGKEY" 2>/dev/null)\n\ $(cat "/tmp/syssett$LWCFGKEY" 2>/dev/null)"|sedspaces))" @@ -2933,8 +2947,15 @@ lu_config() { --field="DXR/RTX (Ray Tracing):CHK" "$DXR" \ 1> /tmp/winesett$LWCFGKEY & + local SETT_EXE_ARGS=() + for arg in "${EXE_ARGS[@]}" + do + [[ "$arg" == *' '* ]] && \ + SETT_EXE_ARGS+=("\"$(sed 's|\\|\\\\\\\\\\\\|g'<<<"$arg")\"")||\ + SETT_EXE_ARGS+=("$(sed 's|\\|\\\\\\\\\\\\|g'<<<"$arg")") + done yad --plug=$LWCFGKEY --tabnum=2 --form --separator="\n" --quoted-output --bool-fmt=1 --columns=2 "${YADSCROLL[@]}" \ - --field="EXE arguments::CBE" "$(echo "$EXE_ARG"|eval $AWKFIX)" \ + --field="EXE arguments::CBE" "$(echo "${SETT_EXE_ARGS[@]}"|eval $AWKFIX)" \ --field="Check update days (0-disabled)::NUM" "$CHK_UPDATE" \ --field="Run EXE DB script:CHK" "$EXE_LWDB" \ --field="EXE DB script::FL" "$EXE_LWDBFL" \ @@ -3274,7 +3295,7 @@ lu_explorer() { fi full_init UNSET_CMPSTR_SW=1 - unset EXE_ARG + unset EXE_ARGS export DEBUG=0 lu_run explorer } @@ -3288,7 +3309,7 @@ lu_regedit() { full_init UNSET_CMPSTR_SW=1 export DEBUG=0 - unset EXE_ARG + unset EXE_ARGS lu_run regedit } @@ -3301,7 +3322,7 @@ lu_control() { full_init UNSET_CMPSTR_SW=1 export DEBUG=0 - unset EXE_ARG + unset EXE_ARGS lu_run control } @@ -3314,7 +3335,7 @@ lu_winecfg() { full_init UNSET_CMPSTR_SW=1 export DEBUG=0 - unset EXE_ARG + unset EXE_ARGS lu_run winecfg } @@ -3327,7 +3348,7 @@ lu_taskmgr() { full_init UNSET_CMPSTR_SW=1 export DEBUG=0 - unset EXE_ARG + unset EXE_ARGS lu_run taskmgr } @@ -3340,7 +3361,7 @@ lu_uninstaller() { full_init UNSET_CMPSTR_SW=1 export DEBUG=0 - unset EXE_ARG + unset EXE_ARGS lu_run uninstaller } @@ -3351,9 +3372,9 @@ winetricks() { exit 1 fi unset WTRX_ARG WTRX_RUN - WTRX_RUN="$(echo "$FULLCMDLINE"|grep -wo '\-winetricks')" + WTRX_RUN="$(echo "${FULLCMDLINE[@]}"|grep -wo '\-winetricks')" [[ ! -n "$NEED_INSTALL_DLLS" && -n "$2" && ! -f "$2" \ - && ! -d "$2" && ! -L "$2" ]] && export WTRX_ARG="${*:2}" + && ! -d "$2" && ! -L "$2" ]] && export WTRX_ARG=("${@:2}") check_winepfx check_wine_pids [[ ! -n "$WINE_PIDS" && -n "$OLD_WINE" ]] && unset OLD_WINE @@ -3375,10 +3396,10 @@ winetricks() { DISABLE_MANGOHUD=1 DISABLE_VKBASALT=1 /usr/bin/winetricks" elif [[ -n "$NEED_INSTALL_DLLS" && ! -n "$WTRX_ARG" && ! -n "$WTRX_RUN" ]] then - DISABLE_MANGOHUD=1 DISABLE_VKBASALT=1 /usr/bin/winetricks $@ || return 1 + DISABLE_MANGOHUD=1 DISABLE_VKBASALT=1 /usr/bin/winetricks "$@" || return 1 elif [[ ! -n "$NEED_INSTALL_DLLS" && -n "$WTRX_ARG" ]] then - DISABLE_MANGOHUD=1 DISABLE_VKBASALT=1 /usr/bin/winetricks $WTRX_ARG || return 1 + DISABLE_MANGOHUD=1 DISABLE_VKBASALT=1 /usr/bin/winetricks "${WTRX_ARG[@]}" || return 1 fi else print_error yad "Winetricks" "Winetricks not found in your system. Using Lux Wine winetricks!" @@ -3389,9 +3410,9 @@ winetricks() { DISABLE_MANGOHUD=1 DISABLE_VKBASALT=1 '$LW_WTRX_DIR/winetricks'" elif [[ ! -n "$WTRX_ARG" && ! -n "$WTRX_RUN" ]] then - DISABLE_MANGOHUD=1 DISABLE_VKBASALT=1 "$LW_WTRX_DIR/winetricks" $@ || return 1 + DISABLE_MANGOHUD=1 DISABLE_VKBASALT=1 "$LW_WTRX_DIR/winetricks" "$@" || return 1 else - DISABLE_MANGOHUD=1 DISABLE_VKBASALT=1 "$LW_WTRX_DIR/winetricks" $WTRX_ARG || return 1 + DISABLE_MANGOHUD=1 DISABLE_VKBASALT=1 "$LW_WTRX_DIR/winetricks" "${WTRX_ARG[@]}" || return 1 fi fi else @@ -3405,10 +3426,10 @@ winetricks() { DISABLE_MANGOHUD=1 DISABLE_VKBASALT=1 '$LW_WTRX_DIR/winetricks'" elif [[ -n "$NEED_INSTALL_DLLS" && ! -n "$WTRX_ARG" && ! -n "$WTRX_RUN" ]] then - DISABLE_MANGOHUD=1 DISABLE_VKBASALT=1 "$LW_WTRX_DIR/winetricks" $@ || return 1 + DISABLE_MANGOHUD=1 DISABLE_VKBASALT=1 "$LW_WTRX_DIR/winetricks" "$@" || return 1 elif [[ ! -n "$NEED_INSTALL_DLLS" && -n "$WTRX_ARG" ]] then - DISABLE_MANGOHUD=1 DISABLE_VKBASALT=1 "$LW_WTRX_DIR/winetricks" $WTRX_ARG || return 1 + DISABLE_MANGOHUD=1 DISABLE_VKBASALT=1 "$LW_WTRX_DIR/winetricks" "${WTRX_ARG[@]}" || return 1 fi fi [[ -n "$NEW_WINE" && -f "$NEW_WINE" ]] && export WINE="$NEW_WINE" @@ -3599,6 +3620,29 @@ lu_clearpfx() { fi } +is_app_exist() { + ret=1 + unset args + if [ -n "$2" ] + then + [ "$lurmapp" == 1 ] && \ + local args="$(sed 's|"|\"|g;s|\\|\\\\|g'<<<"$2")"||\ + local args="$(sed 's|"|\"|g;s|\\|\\\\\\\\|g'<<<"$2")" + fi + for app in "$LW_APPS_DIR"/* + do + [ -n "$(if [ -n "$args" ] + then + awk -v s="Exec='$LWRAP' '$1' $args" '$0==s' "$app" 2>/dev/null + awk -v s="Exec='$LWRAP' \"$1\" $args" '$0==s' "$app" 2>/dev/null + else + awk -v s="Exec='$LWRAP' '$1'" '$0==s' "$app" 2>/dev/null + awk -v s="Exec='$LWRAP' \"$1\"" '$0==s' "$app" 2>/dev/null + fi|head -1)" ] && ret=0 && echo "$app" && break + done + return $ret +} + lu_rmapp() { if [ ! -n "$(pgrep -fa yad|grep "Shortcuts Remover"|awk '{print$1}')" ]; then : else @@ -3612,13 +3656,9 @@ lu_rmapp() { try_rm "$LW_APPS_DIR" fi } - find_app_exe_with_arg() { - grep -F "'$LU_EXE' $EXE_ARG" -lr "$LW_APPS_DIR" 2>/dev/null||\ - grep -F "\"$LU_EXE\" $EXE_ARG" -lr "$LW_APPS_DIR" 2>/dev/null - } rm_srtcts() { (IFS=$'\n' - if [ -n "$@" ] + if [ -n "$1" ] then for LWAPPRM in $@ do @@ -3665,16 +3705,20 @@ lu_rmapp() { else [ -n "$1" ] && LU_EXE="$1" fi fi - if [[ -n "$(echo "$LU_EXE"|grep -Eiom1 '\.exe$|\.bat$'||\ - grep -iom1 "^Name=$LU_EXE$" -lr "$MENU_APPS_DIR" 2>/dev/null)" ]] + grep -qiom1 "^Name=$LU_EXE$" -lr "$MENU_APPS_DIR" 2>/dev/null && \ + get_app_exe "$LU_EXE" + if [[ -n "$(grep -Eiom1 '\.exe$|\.bat$'<<<"$LU_EXE")" ]] then (IFS=$'\n' - if [ -n "$EXE_ARG" ] - then LWAPPSRM=($(find_app_exe_with_arg)) - else LWAPPSRM=($(grep -F "$LU_EXE" -lr "$MENU_APPS_DIR" 2>/dev/null)) + local lurmapp=1 + if [ "$RM_ALL_EXE_APPS" == 1 ] + then LWAPPSRM=($(grep -F "$LU_EXE" -lr "$MENU_APPS_DIR" 2>/dev/null)) + elif [ -n "$EXEARGS" ] + then LWAPPSRM=($(is_app_exist "$LU_EXE" "$EXEARGS")) + else LWAPPSRM=($(is_app_exist "$LU_EXE")) fi - if [ -n "${LWAPPSRM[*]}" ] - then rm_srtcts "${LWAPPSRM[*]}" + if [ -n "$LWAPPSRM" ] + then rm_srtcts "${LWAPPSRM[@]}" else print_error yad "Shortcuts Remover" "'$LU_EXE' not found in the menu!" fi) else @@ -3689,7 +3733,7 @@ lu_rmapp() { LW_APP_RM="$(echo "$LW_APP_RM"|sed '/^TRUE$/d'|sed '/^$/d')" (IFS=$'\n' ; for LWAPPRM in $LW_APP_RM do - LWSHRTRM="$(echo "$LWAPPSHRT"|xargs -d "\n" -I {} grep -lo "Name=$LWAPPRM" {} 2>/dev/null)" + LWSHRTRM="$(echo "$LWAPPSHRT"|xargs -d "\n" -I {} grep -lo "^Name=$LWAPPRM$" {} 2>/dev/null)" rm_srtcts "$LWSHRTRM" done) fi @@ -3718,16 +3762,23 @@ shrt_from_lnk() { unset exe_ico lnk_exe_ico lnk_args lnk_data="$(exiftool "$lnk_file")" lnk_name="$(basename "$lnk_file")" + orig_lnk_name="$lnk_name" if grep -qwo 'Start Menu/Programs'<<<"$lnk_file" then - old_lnk_name="$lnk_name" - lnk_name="$(basename "$(dirname "$lnk_file")"|sed 's| \[GOG.com\]||i')" + lnk_dir="$(basename "$(dirname "$lnk_file")"|sed 's| \[GOG.com\]||i')" IGNLNKDIRS=('by.xatab' 'Programs') - IGNLNKNAMES=('Запустить игру.lnk' 'Launch the game.lnk' "${lnk_name}.lnk") - if [[ "${IGNLNKDIRS[@],,}" =~ "${lnk_name,,}" ]] - then lnk_name="$old_lnk_name" - elif [[ ! "${IGNLNKNAMES[@],,}" =~ "${old_lnk_name,,}" ]] - then lnk_name+=" - $old_lnk_name" + IGNLNKNAMES=( + 'Запустить игру.lnk' 'Launch the game.lnk' + "Launch ${lnk_dir}.lnk" "Играть ${lnk_dir}.lnk" + "Запустить ${lnk_dir}.lnk" "Play ${lnk_dir}.lnk" + ) + if [[ "${IGNLNKDIRS[@],,}" =~ "${lnk_dir,,}" ]]||\ + grep -qo "^$lnk_dir"<<<"$lnk_name"||\ + grep -qo "^$(sed 's|.*/Start Menu/Programs/||;s| \[GOG.com\]||i'\ + <<<"$lnk_file"|awk -F'/' '{print$1}')"<<<"$lnk_name"; then true + elif [[ "${IGNLNKNAMES[@],,}" =~ "${lnk_name,,}" ]] + then lnk_name="$lnk_dir" + else lnk_name="$(sed 's|.*/Start Menu/Programs/||;s| \[GOG.com\]||i;s|/| - |g'<<<"$lnk_file")" fi fi lnk_name_alnum="${lnk_name//[^[:alnum:] ._-]/}" @@ -3753,15 +3804,14 @@ shrt_from_lnk() { BROKEICONEXES=('Warframe.*/Launcher.exe') if [[ -n "$(echo "$lnk_exe_name"|grep -Eio '\.exe$|\.bat$')" && \ ! "${IGNEXES[@],,}" =~ "${lnk_exe_name,,}" && \ - ! "${IGNLNK[@],,}" =~ "${lnk_name,,}" && \ + ! "${IGNLNK[@],,}" =~ "${orig_lnk_name,,}" && \ "$lnk_args" != "--uninstall" ]] then LU_EXE="$lnk_exe" if [ -f "$LU_EXE" ] then - if [[ -n "$lnk_args" && ! -n "$(grep -F "'$lnk_exe' $lnk_args" -lr "$LW_APPS_DIR" 2>/dev/null||\ - grep -F "\"$lnk_exe\" $lnk_args" -lr "$LW_APPS_DIR" 2>/dev/null)" ]]|| \ - [[ ! -n "$lnk_args" && ! -n "$(grep "['\"] ['\"]$lnk_exe['\"]$" -lr "$LW_APPS_DIR" 2>/dev/null)" ]] + if ([ -n "$lnk_args" ] && ! is_app_exist "$lnk_exe" "$lnk_args" &>/dev/null)||\ + ([ ! -n "$lnk_args" ] && ! is_app_exist "$lnk_exe" &>/dev/null) then for broken in "${BROKEICONEXES[@]}" do [ -n "$(echo "$lnk_exe"|grep -io "$broken")" ] && \ @@ -3814,14 +3864,20 @@ shrt_from_url() { url_file_name="$(basename "$url_file")" if grep -qwo 'Start Menu/Programs'<<<"$url_file" then - old_url_name="$url_file_name" - url_file_name="$(basename "$(dirname "$url_file")"|sed 's| \[GOG.com\]||i')" + url_dir="$(basename "$(dirname "$url_file")"|sed 's| \[GOG.com\]||i')" IGNURLDIRS=('by.xatab' 'Programs') - IGNURLNAMES=('Запустить игру.url' 'Launch the game.url' "${url_file_name}.url") - if [[ "${IGNURLDIRS[@],,}" =~ "${url_file_name,,}" ]] - then url_file_name="$old_url_name" - elif [[ ! "${IGNURLNAMES[@],,}" =~ "${old_url_name,,}" ]] - then url_file_name+=" - $old_url_name" + IGNURLNAMES=( + 'Запустить игру.url' 'Launch the game.url' + "Launch ${url_dir}.url" "Играть ${url_dir}.url" + "Запустить ${url_dir}.url" "Play ${url_dir}.url" + ) + if [[ "${IGNURLDIRS[@],,}" =~ "${url_dir,,}" ]]||\ + grep -qo "^$url_dir"<<<"$url_file_name"||\ + grep -qo "^$(sed 's|.*/Start Menu/Programs/||;s| \[GOG.com\]||i'\ + <<<"$url_file"|awk -F'/' '{print$1}')"<<<"$url_file_name"; then true + elif [[ "${IGNURLNAMES[@],,}" =~ "${url_file_name,,}" ]] + then url_file_name="$url_dir" + else url_file_name="$(sed 's|.*/Start Menu/Programs/||;s| \[GOG.com\]||i;s|/| - |g'<<<"$url_file")" fi fi url_file_name_alnum="${url_file_name//[^[:alnum:] ._-]/}" @@ -3844,8 +3900,7 @@ shrt_from_url() { url_exe_ico="$(ipath "$(url_exe_drive="$url_exe_ico_drive" ; echo "$url_exe_ico"|fix_path)"|head -1)" if [ -f "$LU_EXE" ] then - if [[ ! -n "$(grep -F "'$LU_EXE' $url_name" -lr "$LW_APPS_DIR" 2>/dev/null||\ - grep -F "\"$LU_EXE\" $url_name" -lr "$LW_APPS_DIR" 2>/dev/null)" ]] + if ! is_app_exist "$LU_EXE" "$url_name" &>/dev/null then if [ -f "$url_exe_ico" ] then @@ -3897,17 +3952,18 @@ lu_shortcut() { print_error yad "Shortcuts Creator" "Lux Wine Shortcuts Creator already runing!" exit 1 fi - if [ -n "$(grep -io "\.lnk$"<<<"$LU_EXE")" ] - then shrt_from_lnk "$(realpath "$LU_START")" - elif [ -n "$(grep -io "\.url$"<<<"$LU_EXE")" ] - then shrt_from_url "$(realpath "$LU_START")" + if [ -n "$(grep -io "\.lnk$"<<<"$LU_START")" ] + then shrt_from_lnk "$LU_START" + elif [ -n "$(grep -io "\.url$"<<<"$LU_START")" ] + then shrt_from_url "$LU_START" elif [ -f "$LU_EXE" ] then get_shrt_data "$LU_EXE" create_shortcut "$LU_EXE" else SHRT_EXE="$(yad --window-icon="$LW_DEF_ICO" --title "Lux Wine Shortcuts Creator" --file --center \ - --file-filter="*.[Ee][Xx][Ee] *.[Ll][Nn][Kk]" --on-top --width=900 --height=600 --button="EXIT:1" --button="OK:0" 2>/dev/null)" + --file-filter="*.[Ee][Xx][Ee] *.[Ll][Nn][Kk] *.[Uu][Rr][Ll]" --on-top \ + --width=900 --height=600 --button="EXIT:1" --button="OK:0" 2>/dev/null)" if [ -f "$SHRT_EXE" ] then export SHRT_FL="$(readlink -f "$SHRT_EXE")" @@ -3917,9 +3973,13 @@ lu_shortcut() { lite_init "$LU_EXE" get_shrt_data "$LU_EXE" create_shortcut "$LU_EXE" - else - print_error yad "Shortcuts Creator" "Unable to create Lux Wine shortcut for this file!" - lu_shortcut + elif [ -n "$(grep -io "\.lnk$"<<<"$SHRT_FL")" ] + then shrt_from_lnk "$SHRT_FL" + elif [ -n "$(grep -io "\.url$"<<<"$SHRT_FL")" ] + then shrt_from_url "$SHRT_FL" + else + print_error yad "Shortcuts Creator" "Unable to create Lux Wine shortcut for this file!" + lu_shortcut fi elif [ -d "$SHRT_EXE" ] then @@ -5838,24 +5898,47 @@ check_videodrv() { fi } -exeargs_upd() { - if [ -n "$EXE_ARG" ] - then - if [ ! -n "$(echo "$EXE_ARG"|grep -ow "$1" 2>/dev/null)" ] +exeargs_parse() { + sed_arg_quotes() { sed "s|^\"||;s|\"$||;s|^'||;s|'$||" ; } + local char + local result='' + local inside='' + for (( i=0 ; i<${#EXEARGS} ; i++ )) + do + char="${EXEARGS:i:1}" + if [ -n "$inside" ] then - export EXE_ARG="$1 $EXE_ARG" + if [[ "$char" == \\ ]] + then + if [[ "$inside" == '"' && "${EXEARGS:i+1:1}" == '"' ]] + then + let i++ + char="$inside" + fi + elif [[ "$char" == "$inside" ]] + then inside='' + fi + else + if [[ "$char" == '"' ]] + then inside="$char" + elif [[ "$char" == ' ' ]] + then + char='' + EXE_ARGS+=("$(sed_arg_quotes<<<"$result")") + result='' + fi fi - else - export EXE_ARG="$1" - fi + result+="$char" + done + [ -n "$result" ] && \ + EXE_ARGS+=("$(sed_arg_quotes<<<"$result")") } check_exe_args() { - [ -n "$1" ] && export EXEARGS="$1" - if [ -n "$EXEARGS" ] - then - exeargs_upd "$EXEARGS" - fi + [ -n "$1" ] && \ + EXE_ARGS+=("$@") + [ -n "$EXEARGS" ] && \ + exeargs_parse } check_wmonover() { @@ -5893,10 +5976,10 @@ 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 \ + check_wined3d check_vkbasalt_eff check_luwine_wcfg_cenv check_videodrv check_startfile check_def_config get_wk4_releases is_app_exist \ settingbar initbar check_network_status print_question print_input loadbar_cover check_first_run check_eac check_loadbar_cover \ 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 exeargs_upd check_exe_args \ + 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 } @@ -6356,14 +6439,16 @@ lu_lsapp() { get_app_exe() { LU_EXE="$(grep -Eiom1 " [\"']/.*\.exe| [\"']/.*\.bat" "$(grep -wm1 "^Name=$1$" -lr "$LW_APPS_DIR" \ 2>/dev/null|head -1)" 2>/dev/null|sed "s|^ ['\"]||g" 2>/dev/null)" - EXE_ARG="$(grep -Eiom1 " [\"']/.*\.exe.*| [\"']/.*\.bat.*" "$(grep -wm1 "^Name=$1$" -lr "$LW_APPS_DIR" \ + EXEARGS="$(grep -Eiom1 " [\"']/.*\.exe.*| [\"']/.*\.bat.*" "$(grep -wm1 "^Name=$1$" -lr "$LW_APPS_DIR" \ 2>/dev/null|head -1)" 2>/dev/null|sed "s| ['\"]$LU_EXE['\"]||gi;s|^ ||g;s| $||g" 2>/dev/null)" + export EXE_ARGS=() + exeargs_parse [ ! -n "$LU_EXE" ] && \ return 1||return 0 } lu_runapp() { - unset LU_EXE EXE_ARG + unset LU_EXE EXE_ARGS shift if [ -n "$1" ] then @@ -6383,7 +6468,7 @@ lu_runapp() { exit 1 fi shift - cleanrun env LWPPID="$LWPPID" "$LW_SOURCE" "$LU_EXE" $EXE_ARG "$@" + cleanrun env LWPPID="$LWPPID" "$LW_SOURCE" "$LU_EXE" "${EXE_ARGS[@]}" "$@" else print_error yad "Specify App for launch!" exit 1 diff --git a/lwrap/PKGBUILD b/lwrap/PKGBUILD index 7152a4b..c58f9d6 100644 --- a/lwrap/PKGBUILD +++ b/lwrap/PKGBUILD @@ -2,7 +2,7 @@ pkgname='lwrap' pkgver='0.78.2' -pkgrel='6' +pkgrel='7' pkgdesc='Lux Wine wrapper for RunImage container' arch=('x86_64') url='https://github.com/VHSgunzo/lux-wine'