Skip to content

Instantly share code, notes, and snippets.

@imLinguin
Created May 29, 2022 14:22
Show Gist options
  • Save imLinguin/9edde9ae41cac6eef38d30efa0e3745c to your computer and use it in GitHub Desktop.
Save imLinguin/9edde9ae41cac6eef38d30efa0e3745c to your computer and use it in GitHub Desktop.
Wrapper script to use Bottles like wine binary in tools like Legendary.
#!/bin/sh
if [ -z $HGL_BOTTLE_NAME ]; then
echo "NO HGL_BOTTLE_NAME?"
exit 1
fi
if [ $# -eq 0 ]; then
echo "NO EXE?"
exit 1
fi
if flatpak info com.usebottles.bottles &>/dev/null; then
sh -c "flatpak run --command='bottles-cli' com.usebottles.bottles run -b $HGL_BOTTLE_NAME -e \"$1\" $(if [[ $# -ne 1 ]]; then echo "-a \"${@:2}\""; fi)"
else
if which bottles-cli &>/dev/null; then
sh -c "bottles-cli run -b $HGL_BOTTLE_NAME -e \"$1\" $(if [[ $# -ne 1 ]]; then echo "-a \"${@:2}\""; fi)"
else
echo "BOTTLES NOT INSTALLED"
exit 1
fi
fi
exit $?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment