分页: 1 / 1

ubuntu 播放音乐等的提示信息的方块是怎么实现的?

发表于 : 2015-04-17 10:31
loujiaye
见图

这个有办法通过程序控制吗

Re: ubuntu 播放音乐等的提示信息的方块是怎么实现的?

发表于 : 2015-04-17 14:17
astolia
这是linux的桌面通知框架,算是一个标准了。ubuntu现在用的是notify-osd实现,以前用的是notification-daemon。
程序中一般通过libnotify库进行处理,直接通过dbus发消息也行
有命令行工具notify-send,包含在libnotify-bin包中。一般的脚本编程可以考虑用这个

代码: 全选

notify-send -i face-cool 标题 这是内容

代码: 全选

$ notify-send --help
Usage:
  notify-send [OPTION...] <SUMMARY> [BODY] - create a notification

Help Options:
  -?, --help                        Show help options

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


Re: ubuntu 播放音乐等的提示信息的方块是怎么实现的?

发表于 : 2015-04-18 14:54
loujiaye
多谢 :em05