分享 好用的发送桌面 notify 的小工具

case2111 · 2016年04月12日 · 最后由 steveltn 回复于 2016年04月19日 · 2362 次阅读

今天发现 ubuntu 下面有个好用方便的发 notify 的小工具 notify-send

DISPLAY=:0.0 notify-send -t 3000 "休息" "休息一下"

显示图片:

以后写到crontab里面定期提醒,休息,喝水

 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. 

这个功能不错,可以试一试!

mac 下我用的是 terminal-notifier

0,30 * * * * /bin/bash -l -c "terminal-notifier -message '每半个小时要注意休息一下,扭扭脖子喝喝水' -title '为了健康,停一下吧'"

重点是!!!到后来就能自动无视这个弹出窗了

#2 楼 @martin91 我用这个小工具来管理耗时很长的 shell 命令。先 alias 成 notify。

some command ; notify 完成了提醒一下 some command && notify 成功的话提醒一下 some command || notify 失败的话提醒一下

需要 登录 后方可回复, 如果你还没有账号请 注册新账号