Notify-send
时间:2010-09-25 来源:studyboy_3w
Ubuntu 9.04 新通知机制 -Notify-send
0、关于Ubuntu Notification,大家到网上查找相关资料吧,本博客重点在于举例。这里是ubuntu wiki解释:https://wiki.ubuntu.com/NotifyOSD1、安装notify-send软件包,即命令:sudo apt-get install libnotify-bin
2、测试:notify-send "I am title" "Hello, I am send by notify-send utils"

3、应用notify-send改善我之前一篇文章写到的整点/半点报时,见:http://hi.baidu.com/livewithgnome/blog/item/f2a7a34740005a2fcefca37c.html
终端下输入命令 crontab -e 加入下列计划任务:
0,30 * * * * DISPLAY=:0 ~/.script/time-notify.sh ,意思是在每天每时的整点及半点运行脚本 time-notify.sh ,脚本 time-notify.sh 内容如下:
-sh->
#!/bin/bash
# using zenity to display a time tips
DATE_TIME=`date`
notify-send -i gnome-time-set "$DATE_TIME" "Need a rest?"
# 这里把时间提示换成了使用notify-send来提示,-i选项是指定图标,效果截图展示
-sh-<
执行的结果如图,它将在整点及半点时自动运行。
相关阅读 更多 +