Created
May 29, 2022 14:22
-
-
Save imLinguin/9edde9ae41cac6eef38d30efa0e3745c to your computer and use it in GitHub Desktop.
Wrapper script to use Bottles like wine binary in tools like Legendary.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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