Skip to content
This repository has been archived by the owner on Jan 20, 2023. It is now read-only.

Commit

Permalink
Optimized switch to deepin-wine
Browse files Browse the repository at this point in the history
Signed-off-by: Codist <countstarlight@gmail.com>
  • Loading branch information
vufa committed May 10, 2020
1 parent 47e4aa0 commit dbd6fa3
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 36 deletions.
4 changes: 2 additions & 2 deletions .SRCINFO
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pkgbase = deepin-wine-tim
pkgdesc = Tencent TIM (com.qq.office) on Deepin Wine For Archlinux
pkgver = 3.0.0.21315
pkgrel = 1
pkgrel = 2
url = http://tim.qq.com/
install = deepin-wine-tim.install
arch = x86_64
Expand All @@ -27,7 +27,7 @@ pkgbase = deepin-wine-tim
source = reg.patch
md5sums = d5c37cb4f960e13111ce24dbc0dd2d58
md5sums = 05ccc6f90f26170c83f00d28628c1e2b
md5sums = 812b2e77ab9b559278915eeb803a2d9e
md5sums = 73930f0bdd8004536ea59d29eb943ad3
md5sums = 79efbcfa58f4f3d539f09ed5951a0899

pkgname = deepin-wine-tim
Expand Down
14 changes: 3 additions & 11 deletions PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
pkgname=deepin-wine-tim
pkgver=3.0.0.21315
deepintimver=2.0.0deepin4
pkgrel=1
pkgrel=2
pkgdesc="Tencent TIM (com.qq.office) on Deepin Wine For Archlinux"
arch=("x86_64")
url="http://tim.qq.com/"
Expand All @@ -18,7 +18,7 @@ source=("$_mirror/pool/non-free/d/deepin.com.qq.office/deepin.com.qq.office_${de
"reg.patch")
md5sums=('d5c37cb4f960e13111ce24dbc0dd2d58'
'05ccc6f90f26170c83f00d28628c1e2b'
'812b2e77ab9b559278915eeb803a2d9e'
'73930f0bdd8004536ea59d29eb943ad3'
'79efbcfa58f4f3d539f09ed5951a0899')

build() {
Expand Down Expand Up @@ -46,15 +46,7 @@ package() {
msg "Copying TIM to /opt/deepinwine/apps/Deepin-TIM ..."
install -d "${pkgdir}/opt/deepinwine/apps/Deepin-TIM"
install -m644 "${srcdir}/files.7z" "${pkgdir}/opt/deepinwine/apps/Deepin-TIM/"
install -m644 "${srcdir}/reg.patch" "${pkgdir}/opt/deepinwine/apps/Deepin-TIM/"
install -m755 "${srcdir}/run.sh" "${pkgdir}/opt/deepinwine/apps/Deepin-TIM/"
install -m644 "${srcdir}/TIM$pkgver.exe" "${pkgdir}/opt/deepinwine/apps/Deepin-TIM/"
msg "Printing help info ..."
echo -e "\033[0;34m=========================提示/INFO==============================="
echo -e "\033[0;34m* 报告问题(Report issue):"
echo -e "\033[0;34m https://github.com/countstarlight/deepin-wine-tim-arch/issues"
echo -e "\033[0;34m* 切换到 'deepin-wine'(Switch to 'deepin-wine'):"
echo -e "\033[0;34m https://github.com/countstarlight/deepin-wine-tim-arch"
echo -e "\033[0;34m* 安装包下载(Installation package download):"
echo -e "\033[0;34m https://github.com/countstarlight/deepin-wine-tim-arch/releases"
echo -e "\033[0;34m================================================================="
}
69 changes: 46 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ Deepin 打包的 TIM 容器移植到 Archlinux,不依赖 `deepin-wine`,包
- [用安装包安装](#用安装包安装)
- [本地打包安装](#本地打包安装)
- [切换到 `deepin-wine`](#切换到-deepin-wine)
- [1. 安装 deepin-wine](#1-安装-deepin-wine)
- [2. 修改 `deepin-wine-tim` 的启动文件](#2-修改-deepin-wine-tim-的启动文件)
- [3. 对于非 GNOME 桌面(KDE, XFCE等)](#3-对于非-gnome-桌面kde-xfce等)
- [4. 删除原先的TIM目录](#4-删除原先的tim目录)
- [5. 修复 `deepin-wine` 字体渲染发虚](#5-修复-deepin-wine-字体渲染发虚)
- [自动切换](#自动切换)
- [手动切换](#手动切换)
- [1. 安装 `deepin-wine`](#1-安装-deepin-wine)
- [2. 对于非 GNOME 桌面(KDE, XFCE等)](#2-对于非-gnome-桌面kde-xfce等)
- [3. 删除已安装的TIM目录](#3-删除已安装的tim目录)
- [4. 修复 `deepin-wine` 字体渲染发虚](#4-修复-deepin-wine-字体渲染发虚)
- [字体](#字体)
- [使用其他字体](#使用其他字体)
- [修复字体模糊](#修复字体模糊)
Expand Down Expand Up @@ -103,44 +104,62 @@ sudo pacman -U #下载的包名

## 切换到 `deepin-wine`

由于原版 `wine` 在 [DDE(Deepin Desktop Environment)](https://www.deepin.org/dde/) 上,存在托盘图标无法响应鼠标事件([deepin-wine-tim-arch#21](https://github.com/countstarlight/deepin-wine-tim-arch/issues/21)),边框穿透显示([deepin-wine-wechat-arch#15](https://github.com/countstarlight/deepin-wine-wechat-arch/issues/15)), 无法截图等问题,且原版 `wine` 尚不能实现保存登录密码等功能,可以选择切换到 `deepin-wine`
原版 `wine` 在 [DDE(Deepin Desktop Environment)](https://www.deepin.org/dde/) 上,有托盘图标无法响应鼠标事件([deepin-wine-tim-arch#21](https://github.com/countstarlight/deepin-wine-tim-arch/issues/21))的问题,且原版 `wine` 尚不能实现保存登录密码等功能,可以选择切换到 `deepin-wine`

**注意:切换前先确保 `deepin-wine` 支持**

根据 [deepin-wine-wechat-arch#15](https://github.com/countstarlight/deepin-wine-wechat-arch/issues/15#issuecomment-515455845),[deepin-wine-wechat-arch#27](https://github.com/countstarlight/deepin-wine-wechat-arch/issues/27),由 [@feileb](https://github.com/feileb), [@violetbobo](https://github.com/violetbobo), [@HE7086](https://github.com/HE7086)提供的方法:

### 1. 安装 deepin-wine

### 自动切换

```bash
yay -S deepin-wine
/opt/deepinwine/apps/Deepin-TIM/run.sh -d
```

### 2. 修改 `deepin-wine-tim` 的启动文件
这会安装需要的依赖,移除已安装的TIM目录并回退对注册表文件的修改

修改如下两个文件中的 `WINE_CMD` 的值
切换回 `wine`

`/opt/deepinwine/tools/run.sh`
```bash
rm ~/.deepinwine/Deepin-TIM/deepin
```

`/opt/deepinwine/apps/Deepin-TIM/run.sh`
如果要卸载自动安装的依赖:

```diff
-WINE_CMD="wine"
+WINE_CMD="deepin-wine"
```bash
sudo pacman -Rns deepin-wine xsettingsd lib32-freetype2-infinality-ultimate
```

### 手动切换

#### 1. 安装 `deepin-wine`

```bash
yay -S deepin-wine
```

### 3. 对于非 GNOME 桌面(KDE, XFCE等)
#### 2. 对于非 GNOME 桌面(KDE, XFCE等)

需要安装 `xsettingsd`

需要安装 `gnome-settings-daemon`
根据 [deepin-wine-wechat-arch#36](https://github.com/countstarlight/deepin-wine-wechat-arch/issues/36#issuecomment-612001200),由[Face-Smile](https://github.com/Face-Smile)提供的方法:

```bash
sudo pacman -Sy gnome-settings-daemon
sudo pacman -S xsettingsd
```
并在 `/opt/deepinwine/apps/Deepin-TIM/run.sh` 中加入如下几行:

修改 `/opt/deepinwine/apps/Deepin-TIM/run.sh`

```diff
-WINE_CMD="wine"
+WINE_CMD="deepin-wine"
RunApp()
{
+ if [[ -z "$(ps -e | grep -o gsd-xsettings)" ]]
+ if [[ -z "$(ps -e | grep -o xsettingsd)" ]]
+ then
+ /usr/lib/gsd-xsettings &
+ /usr/bin/xsettingsd &
+ fi
if [ -d "$WINEPREFIX" ]; then
UpdateApp
Expand All @@ -149,13 +168,17 @@ sudo pacman -Sy gnome-settings-daemon
**注意:对 `/opt/deepinwine/apps/Deepin-TIM/run.sh` 的修改会在 `deepin-wine-tim` 更新或重装时被覆盖,可以单独拷贝一份作为启动脚本**
### 4. 删除原先的TIM目录
#### 3. 删除已安装的TIM目录
```bash
rm -rf ~/.deepinwine/Deepin-TIM
```
### 5. 修复 `deepin-wine` 字体渲染发虚
#### 4. 修复 `deepin-wine` 字体渲染发虚
kde桌面参考:[deepin-wine-wechat-arch#36](https://github.com/countstarlight/deepin-wine-wechat-arch/issues/36)
deepin 桌面:
```bash
yay -S lib32-freetype2-infinality-ultimate
Expand Down
13 changes: 13 additions & 0 deletions deepin-wine-tim.install
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
info() {
echo -e "\033[0;34m============================提示/INFO==============================="
echo -e "* 反馈问题(Report issue):"
echo -e " https://github.com/countstarlight/deepin-wine-tim-arch/issues"
echo -e "* 切换到 'deepin-wine'(Switch to 'deepin-wine'):"
echo -e " https://github.com/countstarlight/deepin-wine-tim-arch"
echo -e "* 安装包下载(Installation package download):"
echo -e " https://github.com/countstarlight/deepin-wine-tim-arch/releases"
echo -e "====================================================================\033[0m"
}
post_install() {
info
}
post_upgrade() {
find /home -maxdepth 2 -name ".deepinwine" -exec rm -f \{\}/Deepin-TIM/reinstalled \;
}
Expand Down
37 changes: 37 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,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()
Expand Down Expand Up @@ -93,6 +94,39 @@ CreateBottle()
fi
}

SwitchToDeepinWine()
{
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
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"
if [ -d "$WINEPREFIX" ]; then
RemoveApp
fi
DeployApp
echo -e "\033[0;34mReversing the patch ...\033[0m"
patch -p1 -R -d ${WINEPREFIX} < $APPDIR/reg.patch
echo -e "\033[0;34mCreating flag file '$WINEPREFIX/deepin' ...\033[0m"
touch -f $WINEPREFIX/deepin
echo -e "\033[0;34mDone.\033[0m"
}

# Init
if [ -f "$WINEPREFIX/deepin" ]; then
WINE_CMD="deepin-wine"
if [[ -z "$(ps -e | grep -o gsd-xsettings)" ]] && [[ -z "$(ps -e | grep -o xsettingsd)" ]]; then
/usr/bin/xsettingsd &
fi
fi

if [ -z $1 ]; then
RunApp
exit 0
Expand All @@ -107,6 +141,9 @@ case $1 in
"-e" | "--remove")
RemoveApp
;;
"-d" | "--deepin")
SwitchToDeepinWine
;;
"-u" | "--uri")
RunApp $2
;;
Expand Down

0 comments on commit dbd6fa3

Please sign in to comment.