diff options
author | Codist | 2019-10-23 21:03:04 +0800 |
---|---|---|
committer | Codist | 2019-10-23 21:03:04 +0800 |
commit | 60ee4163c36ddef5c09157a48fe89cdce0c647ca (patch) | |
tree | 1624b57e4866ab9d71c682ae4ca5455759f31b06 /run.sh | |
parent | 0ce5a876278d2388ae60afa24149f18c4454c4f1 (diff) | |
download | aur-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-x | run.sh | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -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 ;; |