aboutsummarylogtreecommitdiffstats
path: root/run.sh
diff options
context:
space:
mode:
authorCodist2020-07-26 12:58:06 +0800
committerCodist2020-07-26 12:58:06 +0800
commit0d10c47f242bb27ea1dee76c2705536c7d2ea51d (patch)
tree182e96805c66333e04544404edbde3ab277cc186 /run.sh
parentdbd6fa35f72cf8b00b61896ba0c8d0bfc2943902 (diff)
downloadaur-0d10c47f242bb27ea1dee76c2705536c7d2ea51d.tar.gz
Optimized switch to deepin-wine
Signed-off-by: Codist <countstarlight@gmail.com>
Diffstat (limited to 'run.sh')
-rwxr-xr-xrun.sh31
1 files changed, 23 insertions, 8 deletions
diff --git a/run.sh b/run.sh
index ba5093039139..6dbdba0b9e07 100755
--- a/run.sh
+++ b/run.sh
@@ -5,6 +5,8 @@
# Author: Li LongYu <lilongyu@linuxdeepin.com>
# Peng Hao <penghao@linuxdeepin.com>
+# Codist <countstarlight@gmail.com>
+
WINEPREFIX="$HOME/.deepinwine/Deepin-TIM"
APPDIR="/opt/deepinwine/apps/Deepin-TIM"
APPVER="3.0.0.21315"
@@ -94,29 +96,42 @@ CreateBottle()
fi
}
+msg()
+{
+ ECHO_LEVEL=("\033[1;32m==> " "\033[1;31m==> ERROR: ")
+ echo -e "${ECHO_LEVEL[$1]}\033[1;37m$2\033[0m"
+}
+
SwitchToDeepinWine()
{
PACKAGE_MANAGER="yay"
+ DEEPIN_WINE_DEPENDS="deepin-wine"
if ! [ -x "$(command -v yay)" ]; then
if ! [ -x "$(command -v yaourt)" ]; then
- echo "Error: Need to install 'yay' or 'yaourt' first." >&2
+ msg 1 "Need to install 'yay' or 'yaourt' first." >&2
exit 1
else
$PACKAGE_MANAGER="yaourt"
fi
- fi
- echo -e "\033[0;34mInstalling dependencies ...\033[0m"
- $PACKAGE_MANAGER -S deepin-wine xsettingsd lib32-freetype2-infinality-ultimate --needed
- echo -e "\033[0;34mRedeploying app ...\033[0m"
+ fi
+ if [[ -z "$(ps -e | grep -o gsd-xsettings)" ]]; then
+ DEEPIN_WINE_DEPENDS="${DEEPIN_WINE_DEPENDS} xsettingsd"
+ fi
+ if [ "$XDG_CURRENT_DESKTOP" = "Deepin" ]; then
+ DEEPIN_WINE_DEPENDS="${DEEPIN_WINE_DEPENDS} lib32-freetype2-infinality-ultimate"
+ fi
+ msg 0 "Installing dependencies: ${DEEPIN_WINE_DEPENDS} ..."
+ $PACKAGE_MANAGER -S ${DEEPIN_WINE_DEPENDS} --needed
+ msg 0 "Redeploying app ..."
if [ -d "$WINEPREFIX" ]; then
RemoveApp
fi
DeployApp
- echo -e "\033[0;34mReversing the patch ...\033[0m"
+ msg 0 "Reversing the patch ..."
patch -p1 -R -d ${WINEPREFIX} < $APPDIR/reg.patch
- echo -e "\033[0;34mCreating flag file '$WINEPREFIX/deepin' ...\033[0m"
+ msg 0 "Creating flag file '$WINEPREFIX/deepin' ..."
touch -f $WINEPREFIX/deepin
- echo -e "\033[0;34mDone.\033[0m"
+ msg 0 "Done."
}
# Init