deepin的dbus有参考文档吗?
Tofloor
poster avatar
130******12
deepin
2019-12-08 00:25
Author
用d-feet打开后好多啊,而且多数methods都不知道干啥用!对于我这种刚刚接触dbus的新手来说,有个文档参考参考感觉很重要啊!
Reply Favorite View the author
All Replies
avatar
wangyingtao
deepin
2019-12-08 03:30
#1
想了解哪个模块的,也许我能帮到你
Reply View the author
avatar
魔法师
deepin
2019-12-08 04:12
#2
wangyingtao 发表于 2019-12-7 19:30
想了解哪个模块的,也许我能帮到你

话说我也想了解
Reply View the author
avatar
130******12
deepin
2019-12-08 08:22
#3
https://bbs.deepin.org/post/186436
想了解哪个模块的,也许我能帮到你

主要是想要一个文档,现在要的是了解 notification。估计后面还是要其它的,主要问题是,不知道那个methods各是要做啥,还有就是参数是哪些。。。。。
Reply View the author
avatar
aida
deepin
2019-12-09 18:26
#4
咱们的dbus就是标准的dbus呢

相关文档可以看
https://www.freedesktop.org/wiki/Software/systemd/dbus/

Reply View the author
avatar
wangyingtao
deepin
2019-12-12 18:39
#5
notification主要就是显示系统通知消息的。消息内容保存在下面的文件,内容是动态变化的(由dde-osd维护增加删除)。
主程序是/usr/lib/deepin-daemon/dde-osd,以前主程序名是deepin-notifications,target目录可能也不同
dbus service文件在/usr/share/dbus-1/services/com.deepin.dde.osd.service

  1. wyt@wyt-PC:~/.local/share/dde-osd$ pwd
  2. /home/wyt/.local/share/dde-osd
  3. wyt@wyt-PC:~/.local/share/dde-osd$ ls
  4. data.db
  5. wyt@wyt-PC:~/.local/share/dde-osd$ sqlite3 data.db
  6. SQLite version 3.27.2 2019-02-25 16:06:06
  7. Enter ".help" for usage hints.
  8. sqlite> .tables
  9. notifications2
  10. sqlite> .schema notifications2
  11. CREATE TABLE notifications2(ID INTEGER PRIMARY KEY   AUTOINCREMENT,Icon TEXT,Summary TEXT,Body TEXT,AppName TEXT,CTime TEXT,ReplacesId TEXT,Timeout TEXT, Action TEXT, Hint TEXT);
  12. sqlite>
Copy the Code
再来看 dbus接口的功能就比较容易了。


ClearRecord清除所有消息内容
CloseNotification 关闭消息显示输入消息的
GetAllRecords 获取所有记录json格式,这里可以获取到id值
GetCapabilities 获取record的key
GetRecordById 获取记录,输入id值
RemoveRecord 删除记录,输入id值
Notify 发送通知接口,返回id appName replacesId=0 appIcon summary body  actions hints expireTimeout
replaceId默认填0,actions可以暂时输入default|Activate|settings,其它的参数可以参考桌面的其它应用发送代码
Toggle 右侧通知显示隐藏
doAction 还不清楚
RecordCount 总数

可以安装个libnotify-bin,用notify-send尝试发送下消息
  1. wyt@wyt-PC:~$ apt-cache policy libnotify-bin
  2. libnotify-bin:
  3.   已安装:0.7.7-4
  4.   候选: 0.7.7-4
  5.   版本列表:
  6. *** 0.7.7-4 500
  7.         500 http://pools.corp.deepin.com/debian-buster stable/main amd64 Packages
  8.         100 /var/lib/dpkg/status
  9. wyt@wyt-PC:~$ notify-send --help
  10. Usage:
  11.   notify-send [OPTION?] [BODY] - create a notification

  12. Help Options:
  13.   -?, --help                        Show help options

  14. Application Options:
  15.   -u, --urgency=LEVEL               Specifies the urgency level (low, normal, critical).
  16.   -t, --expire-time=TIME            Specifies the timeout in milliseconds at which to expire the notification.
  17.   -a, --app-name=APP_NAME           Specifies the app name for the icon
  18.   -i, --icon=ICON[,ICON...]         Specifies an icon filename or stock icon to display.
  19.   -c, --category=TYPE[,TYPE...]     Specifies the notification category.
  20.   -h, --hint=TYPE:NAME:VALUE        Specifies basic extra data to pass. Valid types are int, double, string and byte.
  21.   -v, --version                     Version of the package.

  22. wyt@wyt-PC:~$
Copy the Code


Reply View the author
avatar
130******12
deepin
2019-12-12 19:07
#6
https://bbs.deepin.org/post/186436
notification主要就是显示系统通知消息的。消息内容保存在下面的文件,内容是动态变化的(由dde-osd维护增 ...

thanks,感谢您的帮助,图文真仔细!!!!
Reply View the author
avatar
走钢丝
deepin
2019-12-12 19:28
#7
这个要好好学习一下。
Reply View the author