Skip to content

Instantly share code, notes, and snippets.

@koonix
Last active December 17, 2022 10:29
Show Gist options
  • Save koonix/21fb378ed01f4a49ddad3a21ee27e925 to your computer and use it in GitHub Desktop.
Save koonix/21fb378ed01f4a49ddad3a21ee27e925 to your computer and use it in GitHub Desktop.
winetricks, but for Bottles (https://github.com/bottlesdevs/Bottles).
#!/bin/bash
# winetricks, but for Bottles (https://github.com/bottlesdevs/Bottles).
# config
d=~/.local/share/bottles
set -e
cd ${d:?}/bottles
b=$(printf '%s\n' * | fzf)
r=$(grep '^Runner:' $b/bottle.yml | cut -d' ' -f2)
a=$(grep '^Arch:' $b/bottle.yml | cut -d' ' -f2)
r=$d/runners/${r:?}
export WINEARCH=$a WINE=$r/bin/wine \
WINELOADER=$r/bin/wine WINESERVER=$r/bin/wineserver \
WINEDLLPATH=$r/lib/wine WINEPREFIX=$d/bottles/$b
case $1 in
vc) set -- -q vcrun20{03,05,08,10,12,13,15} corefonts
esac
reg=$d/bottles/$b/user.reg
vd=$(grep -A6 '"Desktop"="Default"' $reg | grep -Eo '[0-9]+x[0-9]+') ||:
[ -n "$vd" ] && winetricks vd=off 2>/dev/null
winetricks "$@"
[ -n "$vd" ] && winetricks vd=$vd 2>/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment