[Newbies] 请问我在deepin上安装的Android版应用,怎么才能收到通知?
Tofloor
poster avatar
Deepin Fans
deepin
2021-12-30 19:39
Author

如题,我在deepin上安装的微信、QQ等应用,如何设置才能在收到消息后,能在系统收到通知?

Reply Favorite View the author
All Replies
心平气和
deepin
2021-12-31 09:20
#1

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

#!/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

效果展示:

QQ截图20211231011851.png

Reply View the author
Deepin Fans
deepin
2022-01-07 23:29
#2
心平气和

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

#!/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

效果展示:

QQ截图20211231011851.png

好的,谢谢。

Reply View the author