Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add irssi hilight support
  • Loading branch information
andrewferk committed Mar 3, 2014
1 parent e51848a commit 5150431
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 0 deletions.
19 changes: 19 additions & 0 deletions irssi/config
Expand Up @@ -190,3 +190,22 @@ keyboard = (
{ key = "meta-down"; id = "command"; data = "nicklist scroll +10"; },
{ key = "meta-up"; id = "command"; data = "nicklist scroll -10"; }
);
hilights = ( { text = "andrewferk"; nick = "no"; word = "yes"; } );
windows = {
1 = { immortal = "yes"; name = "(status)"; level = "ALL"; };
2 = {
items = (
{
type = "CHANNEL";
chat_type = "IRC";
name = "#zftalk";
tag = "freenode";
}
);
};
3 = { name = "hilight"; sticky = "yes"; };
};
mainwindows = {
1 = { first_line = "6"; lines = "61"; };
3 = { first_line = "1"; lines = "5"; };
};
57 changes: 57 additions & 0 deletions irssi/scripts/hilightwin.pl
@@ -0,0 +1,57 @@
#
# Print hilighted messages & private messages to window named "hilight" for
# irssi 0.7.99 by Timo Sirainen
#
# Modded a tiny bit by znx to stop private messages entering the hilighted
# window (can be toggled) and to put up a timestamp.
#

use Irssi;
use POSIX;
use vars qw($VERSION %IRSSI);

$VERSION = "0.02";
%IRSSI = (
authors => "Timo \'cras\' Sirainen, Mark \'znx\' Sangster",
contact => "tss\@iki.fi, znxster\@gmail.com",
name => "hilightwin",
description => "Print hilighted messages to window named \"hilight\"",
license => "Public Domain",
url => "http://irssi.org/",
changed => "Sun May 25 18:59:57 BST 2008"
);

sub sig_printtext {
my ($dest, $text, $stripped) = @_;

my $opt = MSGLEVEL_HILIGHT;

if(Irssi::settings_get_bool('hilightwin_showprivmsg')) {
$opt = MSGLEVEL_HILIGHT|MSGLEVEL_MSGS;
}

if(
($dest->{level} & ($opt)) &&
($dest->{level} & MSGLEVEL_NOHILIGHT) == 0
) {
$window = Irssi::window_find_name('hilight');

if ($dest->{level} & MSGLEVEL_PUBLIC) {
$text = $dest->{target}.": ".$text;
}
$text = strftime(
Irssi::settings_get_str('timestamp_format')." ",
localtime
).$text;
$window->print($text, MSGLEVEL_NEVER) if ($window);
}
}

$window = Irssi::window_find_name('hilight');
Irssi::print("Create a window named 'hilight'") if (!$window);

Irssi::settings_add_bool('hilightwin','hilightwin_showprivmsg',1);

Irssi::signal_add('print text', 'sig_printtext');

# vim:set ts=4 sw=4 et:
8 changes: 8 additions & 0 deletions irssi/startup
@@ -1,4 +1,12 @@
# load and start nicklist
/RUN nicklist.pl
/NICKLIST FIFO

# load sasl support
/RUN cap_sasl.pl

# load highlight support
/RUN highlightwin.pl

# goto first command window
/WINDOW GOTO 1

0 comments on commit 5150431

Please sign in to comment.