Skip to content

Instantly share code, notes, and snippets.

@shmerl
Last active November 3, 2023 05:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shmerl/edf230db5d4a24fd92aea16c31393d89 to your computer and use it in GitHub Desktop.
Save shmerl/edf230db5d4a24fd92aea16c31393d89 to your computer and use it in GitHub Desktop.
Custom Wine running
#!/bin/bash
# Configuration (set through environment variables):
#
# WINEPREFIX - what prefix to use.
# wine_path - to use custom location of Wine (e.g. /opt/wine-main).
# wine - shortcut for the above, to assume /opt/$wine
#
# Notes:
#
# WINEPREFIX this one you most probably need, otherwise, it will fall back to
# default prefix at $HOME/.wine
#
# wine_path should be set if you need custom Wine, otherwise it will fall back to
# default (implicit) Wine, which is a common usage. This is not a Wine env variable,
# but a custom variable used in the script to set a location if needed.
#
# wine can be set without wine_path, to use /opt/$wine location.
#
# Intended to be used with 64-bit prefixes which now support all Wine applications.
#
# Uses wine_env.sh which sets the environment
#
# Additional flags that control the script (used in wine_env.sh)
#
# wine_bin
# values: wine, wine64
# Explicit override of wine binary if you need it for whatever reason.
#
source $(dirname ${BASH_SOURCE[0]})/wine_env.sh
echo "Wine environment"
printf "Wine prefix : "
if [[ "${WINEPREFIX+iset}" ]]; then
echo "$WINEPREFIX"
else
echo "default(!)"
fi
printf "Wine location: "
if [[ "${wine_path+iset}" ]]; then
echo "$wine_path"
else
echo "default"
fi
echo "Wine binary : ${wine_bin}"
echo "==========================================="
$wine_bin "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment