diff options
author | Mike Crute <mcrute@gmail.com> | 2010-12-27 17:26:42 -0500 |
---|---|---|
committer | Mike Crute <mike@crute.us> | 2010-12-27 17:26:42 -0500 |
commit | 9cbc34babbebde3435aa706343035a14def22294 (patch) | |
tree | 28091808b6f526e29524bfc848a99e8f136fe15b /.irssi | |
parent | e70eb99454c4fc73db4d3a00d152e26d74a6169c (diff) | |
download | dotfiles-9cbc34babbebde3435aa706343035a14def22294.tar.bz2 dotfiles-9cbc34babbebde3435aa706343035a14def22294.tar.xz dotfiles-9cbc34babbebde3435aa706343035a14def22294.zip |
Adding highlight window plugin
Diffstat (limited to '.irssi')
-rw-r--r-- | .irssi/scripts/hilightwin.pl | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/.irssi/scripts/hilightwin.pl b/.irssi/scripts/hilightwin.pl new file mode 100644 index 0000000..e508809 --- /dev/null +++ b/.irssi/scripts/hilightwin.pl | |||
@@ -0,0 +1,57 @@ | |||
1 | # | ||
2 | # Print hilighted messages & private messages to window named "hilight" for | ||
3 | # irssi 0.7.99 by Timo Sirainen | ||
4 | # | ||
5 | # Modded a tiny bit by znx to stop private messages entering the hilighted | ||
6 | # window (can be toggled) and to put up a timestamp. | ||
7 | # | ||
8 | |||
9 | use Irssi; | ||
10 | use POSIX; | ||
11 | use vars qw($VERSION %IRSSI); | ||
12 | |||
13 | $VERSION = "0.02"; | ||
14 | %IRSSI = ( | ||
15 | authors => "Timo \'cras\' Sirainen, Mark \'znx\' Sangster", | ||
16 | contact => "tss\@iki.fi, znxster\@gmail.com", | ||
17 | name => "hilightwin", | ||
18 | description => "Print hilighted messages to window named \"hilight\"", | ||
19 | license => "Public Domain", | ||
20 | url => "http://irssi.org/", | ||
21 | changed => "Sun May 25 18:59:57 BST 2008" | ||
22 | ); | ||
23 | |||
24 | sub sig_printtext { | ||
25 | my ($dest, $text, $stripped) = @_; | ||
26 | |||
27 | my $opt = MSGLEVEL_HILIGHT; | ||
28 | |||
29 | if(Irssi::settings_get_bool('hilightwin_showprivmsg')) { | ||
30 | $opt = MSGLEVEL_HILIGHT|MSGLEVEL_MSGS; | ||
31 | } | ||
32 | |||
33 | if( | ||
34 | ($dest->{level} & ($opt)) && | ||
35 | ($dest->{level} & MSGLEVEL_NOHILIGHT) == 0 | ||
36 | ) { | ||
37 | $window = Irssi::window_find_name('hilight'); | ||
38 | |||
39 | if ($dest->{level} & MSGLEVEL_PUBLIC) { | ||
40 | $text = $dest->{target}.": ".$text; | ||
41 | } | ||
42 | $text = strftime( | ||
43 | Irssi::settings_get_str('timestamp_format')." ", | ||
44 | localtime | ||
45 | ).$text; | ||
46 | $window->print($text, MSGLEVEL_NEVER) if ($window); | ||
47 | } | ||
48 | } | ||
49 | |||
50 | $window = Irssi::window_find_name('(hi)'); | ||
51 | Irssi::print("Create a window named 'hilight'") if (!$window); | ||
52 | |||
53 | Irssi::settings_add_bool('hilightwin','hilightwin_showprivmsg',1); | ||
54 | |||
55 | Irssi::signal_add('print text', 'sig_printtext'); | ||
56 | |||
57 | # vim:set ts=4 sw=4 et: | ||