Skip to content

Instantly share code, notes, and snippets.

@marcin-jozwikowski
Created September 6, 2018 09:02
Show Gist options
  • Save marcin-jozwikowski/36674949dc8545ac1f2d6ca3f46afd8d to your computer and use it in GitHub Desktop.
Save marcin-jozwikowski/36674949dc8545ac1f2d6ca3f46afd8d to your computer and use it in GitHub Desktop.
Menu: POL + Wine + WinePrefix + WineTricks
#!/bin/bash
#######################################################
#
# PlayOnLinux Wine and WinePrefix manager
#
# Helps using winetricks with POL and POL prefixes
#
#######################################################
function display_settings {
echo
echo Current settings:
echo PREFIX $WINEPREFIX
echo Binary $WINE
echo
}
display_settings
done=0
while(( !done )); do
COLUMNS=1
PS3='Select WINEPREFIX: '
options=("Create")
options+=($(ls -d ~/.PlayOnLinux/wineprefix/*))
options+=("None")
select opt in "${options[@]}"; do
if [ $opt = "Create" ]; then
newPrefix=''
until [ ! -z $newPrefix ]; do
echo Name new WinePrefix
read newPrefix
done
mkdir ~/.PlayOnLinux/wineprefix/$newPrefix
break
fi
if [ $opt = "None" ]; then
unset WINEPREFIX
done=1
break
fi
if [[ ${options[*]} =~ $opt ]]; then
export WINEPREFIX=$opt
done=1
break
fi
done
done
echo
PS3='Select Binary: '
options=($(ls -d ~/.PlayOnLinux/wine/linux-amd64/*))
options+=("None")
select opt in "${options[@]}"
do
if [ $opt = "None" ]; then
unset WINE
break
fi
if [[ ${options[*]} =~ $opt ]]; then
export WINE=$opt"/bin/wine"
break
fi
done
display_settings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment