aboutsummarylogtreecommitdiffstats
path: root/run.sh
diff options
context:
space:
mode:
authorCodist2019-10-23 21:03:04 +0800
committerCodist2019-10-23 21:03:04 +0800
commit60ee4163c36ddef5c09157a48fe89cdce0c647ca (patch)
tree1624b57e4866ab9d71c682ae4ca5455759f31b06 /run.sh
parent0ce5a876278d2388ae60afa24149f18c4454c4f1 (diff)
downloadaur-60ee4163c36ddef5c09157a48fe89cdce0c647ca.tar.gz
Add switch to deepin-wine to run.sh
Signed-off-by: Codist <countstarlight@gmail.com>
Diffstat (limited to 'run.sh')
-rwxr-xr-xrun.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/run.sh b/run.sh
index 2cc75f7a1bf4..6f4d69db909c 100755
--- a/run.sh
+++ b/run.sh
@@ -4,6 +4,7 @@
#
# Author: Li LongYu <lilongyu@linuxdeepin.com>
# Peng Hao <penghao@linuxdeepin.com>
+# Codist <countstarlight@gmail.com>
WINEPREFIX="$HOME/.deepinwine/Deepin-WeChat"
APPDIR="/opt/deepinwine/apps/Deepin-WeChat"
@@ -18,6 +19,7 @@ HelpApp()
echo " Extra Commands:"
echo " -r/--reset Reset app to fix errors"
echo " -e/--remove Remove deployed app files"
+ echo " -d/--deepin Switch to 'deepin-wine'"
echo " -h/--help Show program help info"
}
CallApp()
@@ -91,6 +93,34 @@ CreateBottle()
fi
}
+SwitchToDeepinWine()
+{
+ if [ -d "$WINEPREFIX" ]; then
+ RemoveApp
+ DeployApp
+ fi
+ PACKAGE_MANAGER="yay"
+ if ! [ -x "$(command -v yay)" ]; then
+ if ! [ -x "$(command -v yaourt)" ]; then
+ echo "Error: Need to install 'yay' or 'yaourt' first." >&2
+ exit 1
+ else
+ $PACKAGE_MANAGER="yaourt"
+ fi
+ fi
+ $PACKAGE_MANAGER -S deepin-wine gnome-settings-daemon lib32-freetype2-infinality-ultimate --needed
+ touch -f $WINEPREFIX/deepin
+ echo "Done."
+}
+
+# Init
+if [ -f "$WINEPREFIX/deepin" ]; then
+ WINE_CMD="deepin-wine"
+ if [[ -z "$(ps -e | grep -o gsd-xsettings)" ]]; then
+ /usr/lib/gsd-xsettings &
+ fi
+fi
+
if [ -z $1 ]; then
RunApp
exit 0
@@ -105,6 +135,9 @@ case $1 in
"-e" | "--remove")
RemoveApp
;;
+ "-d" | "--deepin")
+ SwitchToDeepinWine
+ ;;
"-u" | "--uri")
RunApp $2
;;