]> git.rmz.io Git - dotfiles.git/commitdiff
create wine wrapper
authorSamir Benmendil <ram-z@chakra-project.org>
Tue, 30 Oct 2012 00:48:56 +0000 (01:48 +0100)
committerSamir Benmendil <ram-z@chakra-project.org>
Tue, 30 Oct 2012 00:55:12 +0000 (01:55 +0100)
bin/wine [new file with mode: 0755]

diff --git a/bin/wine b/bin/wine
new file mode 100755 (executable)
index 0000000..848e73b
--- /dev/null
+++ b/bin/wine
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+WINE_HOME=/mnt/sdd5/wineprefixes/wine_home
+
+WINE=/usr/bin/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 "$@"