[Share Experiences] 实现uengine 下的手机微信通知
Tofloor
poster avatar
心平气和
deepin
2021-12-31 09:26
Author

可以通过监听 手机微信的文件来实现通知

#!/bin/bash

file="/data/uengine/data/data/data/com.tencent.mm/shared_prefs/"
inotifywait -mq -e modify $file | while read event
	do
		if [[ "$event" == *notify_sync_pref.xml ]];then
			notify-send -i '/home/tensor/Documents/notify/mm.jpg' ‘主银’ ‘你有微信消息哦~~’
		fi
	done

注意:

  1. notify-send -i 后面 替换成你自己的图片地址
  2. 将/data/uengine/data/data/data/com.tencent.mm/shared_prefs/ 设为当前用户可读写的权限
  3. 需要安装 inotify-tools 安装命令 sudo apt install inotify-tools
  4. 需要开机启动的话,参考Deepin 设置脚本或者程序启动_The space of Shining-CSDN博客_deepin 开机运行脚本 第三种方法

效果展示:

QQ截图20211231011851.png

Reply Favorite View the author
All Replies
liwl
deepin
2022-01-06 19:51
#1

好思路,整得不错,我也整一个

Reply View the author