- 论坛徽章:
- 0
|
转载自:http://www.solarisman.cn/
使用windows时经常会弹出一个窗口提醒一些信息,比如qq,msn新用户登录了,或者正在播放什么歌曲?
Linux/Solaris可以使用”notify-send”非常方便的创建桌面提醒,大家可以尽情发挥想象。大部分操作系统会默认安装”notify-send”。用户也可以通过安装“libnotify”使用”notify-send”
notify-send安装[root@localhost fanyuan]# yum install libnotify
Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
* fedora: mirrors.cat.pdx.edu
* updates: mirrors.cat.pdx.edu
Setting up Install
Process
Package libnotify-0.4.5-2.fc11.i586 already installed and latest version
Nothing to donotify-send使用使用notify-send弹出一个桌面提醒
![]()
bash-3.2# notify-send "hello"默认情况下消息会显示5秒钟,可以使用”-t”选项制定消息的显示时间,时间以毫秒为单位。”-t 0″ 会一直保留提示消息直到用户关闭。
bash-3.2#notify-send "Click me to close me." -t 0使用”-i”选项可以制定消息的图标
![]()
bash-3.2# notify-send "java" -i "/usr/share/pixmaps/sun-java.png"有趣的例子系统会每隔5分钟显示一次系统的运行时间
#!/bin/bash
while
[
1
];
do
notify-send "Up Time"
"`uptime`"
sleep 5m
done |
|