summarylogtreecommitdiffstats
path: root/foobar2000.sh
diff options
context:
space:
mode:
Diffstat (limited to 'foobar2000.sh')
-rw-r--r--foobar2000.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/foobar2000.sh b/foobar2000.sh
new file mode 100644
index 000000000000..f26d04906752
--- /dev/null
+++ b/foobar2000.sh
@@ -0,0 +1,27 @@
+#! /bin/bash
+
+progName="foobar2000"
+progRealPath="/usr/share/$progName"
+progHome="$HOME/.$progName"
+progBin="$progName.exe"
+
+# Symlink stuff
+mkdir -p "$progHome" || exit 1
+# Delete broken symlinks
+find -L "$progHome" -type l -delete
+# Update existing symlinks, add new symlinks
+cp -urs "$progRealPath/"* "$progHome" 2> /dev/null
+
+# Switches: use -something instead of /something to avoid confusion with Unix paths
+# Also convert Unix paths to Windows paths.
+declare -a args
+
+for arg; do
+ if [[ "${arg:0:1}" = "-" ]]; then
+ args+=("${arg/#-//}")
+ else
+ args+=("$(winepath -w "$arg")")
+ fi
+done
+
+wine "$progHome/$progBin" "${args[@]}"