Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

唤醒后台WeChat方案 #263

Closed
metahy opened this issue Nov 29, 2022 · 1 comment
Closed

唤醒后台WeChat方案 #263

metahy opened this issue Nov 29, 2022 · 1 comment

Comments

@metahy
Copy link
Contributor

metahy commented Nov 29, 2022

扒了一遍 /opt/deepinwine/tools/sendkeys.sh, 这个脚本里写的非常臃肿且低效,还有一些语法问题,通过这个脚本来唤醒WeChat可以通过这个命令:

/opt/deepinwine/tools/sendkeys.sh w wechat 4

但是执行时可以看到有非常多的 warning log, 其实这个脚本的最终目的是执行这个命令:

env WINEPREDLL=/opt/apps/com.qq.weixin.deepin/files/dlls WINEDLLPATH=/opt/deepin-wine6-stable/lib:/opt/deepin-wine6-stable/lib64 WINEPREFIX=/home/hyleon/.deepinwine/Deepin-WeChat deepin-wine6-stable /opt/deepinwine/tools/sendkeys.exe w


我的方案:

1. 新建脚本文件

/home/{your_name}/scripts/weakup_wechat.sh

#!/usr/bin/env bash
env WINEPREDLL=/opt/apps/com.qq.weixin.deepin/files/dlls WINEDLLPATH=/opt/deepin-wine6-stable/lib:/opt/deepin-wine6-stable/lib64 WINEPREFIX=/home/hyleon/.deepinwine/Deepin-WeChat deepin-wine6-stable /opt/deepinwine/tools/sendkeys.exe w

(其实这个命令可以精简,env 里并不需要给出那么多,只执行
env WINEPREFIX=/home/hyleon/.deepinwine/Deepin-WeChat deepin-wine6-stable /opt/deepinwine/tools/sendkeys.exe w
效果是一样的)

2. 添加执行权限

chmod +x /home/{your_name}/scripts/weakup_wechat.sh

3. 映射快捷键

具体的 DE or WM 配置方法不同,我使用的是 BSPWM + sxhkd, 所以以 sxhkd 配置快捷键为例:

/home/{your_name}/.config/sxhkd/sxhkdrc

# WeChat
ctrl + alt + w
        /home/{your_name}/scripts/weakup_wechat.sh

然后就可以通过你配置的快捷键(如我配置的是 Ctrl + Alt + w )来唤醒 WeChat 了

(注:配置好快捷键后,根据不用的 DE or WM, 可能需要一些额外的操作来使配置生效,如 sxhkd 可以通过 super + Escape 来 kill 掉 sxhkd 进程来使配置生效)

@vufa
Copy link
Owner

vufa commented Nov 30, 2022

感谢帮助,已经添加到run.sh94e1d89#diff-d31ce0453051853c17ba2a5225b3d1bfab548e095bab0967d6acfd1b3ce1b35dR77

@vufa vufa closed this as completed Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants