Skip to content

Instantly share code, notes, and snippets.

@shmerl
Last active February 27, 2025 03:01
Show Gist options
  • 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.
#
# Uses wine_env.sh which sets the environment
#
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 "$@"
@shmerl
Copy link
Author

shmerl commented Feb 26, 2025

Updated to use latest Wine which got rid of wine64 binary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment