From 342dd058ee318c0d9bc60e992b9f2341e2092d5a Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Thu, 14 Nov 2024 23:19:25 -0800 Subject: [PATCH] Add games/sse-nxmhandler-wrapper.sh --- games/sse-nxmhandler-wrapper.sh | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 games/sse-nxmhandler-wrapper.sh diff --git a/games/sse-nxmhandler-wrapper.sh b/games/sse-nxmhandler-wrapper.sh new file mode 100644 index 0000000..2556099 --- /dev/null +++ b/games/sse-nxmhandler-wrapper.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env zsh + +# WARNING!! This file is not well written. It probably only works on my setup, +# with Lutris thinking it's running Skyrim from GOG, but really running MO2 + +local conf_file="${HOME}/.config/lutris/games/the_elder_scrolls_v_skyrim_special_edition-1703312623.yml" + +local wine_ver="$(cat "${conf_file}" | yq -r ".wine.version")" + +local wine_bin +if [[ -d "${HOME}/.local/share/Steam/compatibilitytools.d/${wine_ver}" ]]; then + wine_bin="${HOME}/.local/share/Steam/compatibilitytools.d/${wine_ver}/files/bin" +elif [[ -d "${HOME}/.local/share/lutris/runners/wine/${wine_ver}" ]]; then + wine_bin="${HOME}/.local/share/lutris/runners/wine/${wine_ver}/bin" +fi + +local wine="${wine_bin}/wine" +local wineserver="${wine_bin}/wineserver" + +let server_pid="$(pgrep -xf "${wineserver}" | head -n1)" + +local server_env_arr=(${(0)"$(