irssi的提示脚本(转)
来源:互联网 发布:js设置浏览器缩放比例 编辑:程序博客网 时间:2024/05/17 02:11
复制以下内容保存为 pl结尾的文件
#转载
##
## Put me in ~/.irssi/scripts, and then execute the following in irssi:
##
## /load perl
## /script load notify
##
use strict;
use Irssi;
use vars qw($VERSION %IRSSI);
$VERSION = "0.01";
%IRSSI = (
authors => 'Luke Macken, Paul W. Frields',
contact => 'lewk@csh.rit.edu, stickster@gmail.com',
name => 'notify.pl',
description => 'Use libnotify to alert user to hilighted messages',
license => 'GNU General Public License',
url => 'http://lewk.org/log/code/irssi-notify',
);
Irssi::settings_add_str('notify', 'notify_icon', 'gtk-dialog-info');
Irssi::settings_add_str('notify', 'notify_time', '5000');
sub notify {
my ($server, $summary, $message) = @_;
# Make the message entity-safe
$message =~ s/&/&/g; # That could have been done better.
$message =~ s/</</g;
$message =~ s/>/>/g;
$message =~ s/'/'/g;
my $cmd = "EXEC - notify-send" .
" -i " . Irssi::settings_get_str('notify_icon') .
" -t " . Irssi::settings_get_str('notify_time') .
" -- '" . $summary . "'" .
" '" . $message . "'";
$server->command($cmd);
}
sub print_text_notify {
my ($dest, $text, $stripped) = @_;
my $server = $dest->{server};
return if (!$server || !($dest->{level} & MSGLEVEL_HILIGHT));
my $sender = $stripped;
$sender =~ s/^/<.([^/>]+)/>.+//1/ ;
$stripped =~ s/^/<.[^/>]+/>.// ;
my $summary = $dest->{target} . ": " . $sender;
notify($server, $summary, $stripped);
}
sub message_private_notify {
my ($server, $msg, $nick, $address) = @_;
return if (!$server);
notify($server, "私人消息来自:".$nick, $msg);
}
sub dcc_request_notify {
my ($dcc, $sendaddr) = @_;
my $server = $dcc->{server};
return if (!$dcc);
notify($server, "文件传送".$dcc->{type}." 来自:", $dcc->{nick});
}
Irssi::signal_add('print text', 'print_text_notify');
Irssi::signal_add('message private', 'message_private_notify');
Irssi::signal_add('dcc request', 'dcc_request_notify');
- irssi的提示脚本(转)
- irssi (IRC软件)使用备份(来自网络)
- 转:去掉IE浏览器里的脚本控件提示
- irssi for windows
- cygwin+irssi安装
- irssi配置使用教程
- sql2000执行sql2005导出的数据脚本时出现“提示含有超过64K限度的行”(转)
- 链接提示文字的脚本实现
- 有用的Ajax自动提示脚本收集
- VBS脚本运行错误提示的解决方法
- 冒泡提示框的纯css脚本
- 关于badboy录制脚本提示脚本错误的解决方法
- 运行vbs脚本,提示“无法找到脚本‘XXX’的脚本引擎“Vbscript”的解决方法
- 【转】SQL Server 2008 R2编写脚本时智能提示功能丢失的处理
- 屏蔽脚本提示
- javascript关闭当前窗体不显示提示框的脚本
- 提出纯脚本的HoverMenuBehavior及冒泡提示框
- IE 7 无提示关闭窗口的脚本
- 使用Sysinternals工具定时休眠Windows Server 2008 R2
- 启用Windows 7/2008 R2 XPS Viewer
- MIX 10 Session下载
- buffer & Test
- 心情不好时请看:小P孩的故事
- irssi的提示脚本(转)
- Silverlight2.0中与Html页面元素互操作.
- SQL UNION 和 UNION ALL 操作符
- 手机音视频流媒体开发一些有用资料
- Struts的核心类
- Symbian数据库浅谈
- Symbian文件操作整理
- flex是什么
- 最全的FLEX网站收集分享