Skip to content

Instantly share code, notes, and snippets.

@attilaolah
Created December 5, 2021 11:18
Show Gist options
  • Save attilaolah/674c5f73d297077dd03cccae55449e0e to your computer and use it in GitHub Desktop.
Save attilaolah/674c5f73d297077dd03cccae55449e0e to your computer and use it in GitHub Desktop.
Kinglet Launcher
#!/usr/bin/env bash
ROOT="${HOME}/legendary"
GAMEDIR="${ROOT}/SidMeiersCivilizationVI"
DXVK="1.9.1"
export WINEPREFIX="${GAMEDIR}.wine"
# Download & copy DXVK libraries.
if [ ! -d "${ROOT}/dxvk-${DXVK}" ]; then
pushd "${ROOT}"
wget "https://github.com/doitsujin/dxvk/releases/download/v${DXVK}/dxvk-${DXVK}.tar.gz"
tar xf "dxvk-${DXVK}.tar.gz"
popd
fi
# Create and update wineprefix on first run of your game.
if [ ! -d "${WINEPREFIX}" ]; then
wineboot --init
# Wait for wineboot to complete.
while [ ! -f "${WINEPREFIX}/system.reg" ]; do
echo "Waiting for Wine to finish booting ${WINEPREFIX}/..."
sleep 1
done
pushd "${WINEPREFIX}/drive_c/users/${USER}"
rm Documents
mkdir Documents
ln -s "../../../../../My Games" Documents
popd
# Install DXVK libs once wineboot is done.
"${ROOT}/dxvk-${DXVK}/setup_dxvk.sh" install
fi
# Enable fsync:
#export WINEESYNC=0
#export WINEFSYNC=1
# Enable esync:
export WINEESYNC=1
export WINEFSYNC=0
# Enable/disable winedebug:
#export WINEDEBUG=-all
# Enable/disable winedebug for waylanddrv:
#export WINEDEBUG=+waylanddrv
# Enable for games that have their own cursor:
#export WINE_VK_HIDE_CURSOR=1
# Enables vulkan only windows, disable to see any GDI error popups.
#export WINE_VK_VULKAN_ONLY=1
# DXVK options here:
#export DXVK_LOG_LEVEL=none
# Enable/disable dxvk_hud
#export DXVK_HUD=1
# Enable disable mangohud if available:
#export MANGOHUD=1
#export MANGOHUD_CONFIG=cpu_temp,gpu_temp,height=100,font_size=20
export WINEDLLOVERRIDES="dxgi,d3d11=n,b;dinput=d;winedbg=d;winemenubuilder.exe=d;mscoree=d;mshtml=d";
legendary launch Kinglet --wine-prefix="${WINEPREFIX}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment