Skip to content

Commit

Permalink
topicche.pl: add theming
Browse files Browse the repository at this point in the history
  • Loading branch information
meh committed Jun 26, 2012
1 parent 39aef17 commit 7581ac3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions perl/irssi/topicche.pl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Irssi::TextUI;
use vars qw($VERSION %IRSSI);

$VERSION = '0.2';
$VERSION = '0.3';
%IRSSI = (
author => 'meh',
contact => 'meh@paranoici.org',
Expand All @@ -27,6 +27,9 @@
# the default ticks waiting before starting the rotation
Irssi::settings_add_int('topicche', 'topicche_wait', 10);

# set the theme formatters at the beginning of the topic
Irssi::settings_add_str('topicche', 'topicche_theme', '');

sub escape {
my $text = shift;

Expand Down Expand Up @@ -95,7 +98,7 @@ sub show {
my $width = $item->{size} - 1;

if ($wait > 0 || length($topic) <= $width) {
$item->default_handler(0, ' ' . escape($topic), undef);
$item->default_handler(0, ' ' . Irssi::settings_get_str('topicche_theme') . escape($topic), undef);
$wait--;

return;
Expand Down Expand Up @@ -123,7 +126,7 @@ sub show {
$current++;
}

$item->default_handler(0, ' ' . escape($text), undef);
$item->default_handler(0, ' ' . Irssi::settings_get_str('topicche_theme') . escape($text), undef);
}

Irssi::statusbar_item_register('topicche', '$0', 'show');
Expand Down

0 comments on commit 7581ac3

Please sign in to comment.