X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/c65b6c2d1f7a03ab75834a38809cba7e91f4ab94..refs/heads/uh-backup:/bin/wine diff --git a/bin/wine b/bin/wine index bca1184..a7dafbb 100755 --- a/bin/wine +++ b/bin/wine @@ -1,7 +1,23 @@ #!/bin/bash -WINE_HOME=/mnt/sdd5/wineprefixes/wine_home +WINE_HOME=/mnt/data/wineprefixes/wine_home WINE=/usr/bin/wine +export WINEARCH=${WINEARCH:-win32} -WINEARCH=${WINEARCH:-win32} HOME="$WINE_HOME" $WINE "$@" +if [[ ! -d "$WINE_HOME" ]]; then + echo "'$WINE_HOME' does not exist, please create it first" + exit 1 +fi + +if [[ ! -d "$WINEPREFIX" ]]; then + wineboot -i + + declare -a DIRS=('Desktop' 'My Documents' 'My Music' 'My Pictures' 'My Videos') + for DIR in "${DIRS[@]}"; do + [[ ! -d "$WINE_HOME/$DIR" ]] && mkdir "$WINE_HOME/$DIR" + ln -sfT "$WINE_HOME/$DIR" "$WINEPREFIX/drive_c/users/$USER/$DIR" + done +fi + +$WINE "$@"