]> git.rmz.io Git - dotfiles.git/blobdiff - bin/wine
Revert "only set HOME in wine"
[dotfiles.git] / bin / wine
index bca118415fbc48b30b12ce0e574bd3ac0ef42704..848e73b1a6dd9137ece49ca55d75911c73bfdc1a 100755 (executable)
--- a/bin/wine
+++ b/bin/wine
@@ -4,4 +4,17 @@ WINE_HOME=/mnt/sdd5/wineprefixes/wine_home
 
 WINE=/usr/bin/wine
 
-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
+
+[[ -d "$WINEPREFIX" ]] || 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
+
+$WINE "$@"