summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--_data/scripts.yaml24
-rw-r--r--_testing/config.yml5
-rw-r--r--scripts/adv_windowlist.pl109
-rw-r--r--scripts/localize.pl8
-rw-r--r--scripts/quiz.pl6
-rw-r--r--scripts/quizmaster-fr.pl8
-rw-r--r--scripts/quizmaster.pl8
-rw-r--r--scripts/sysinfoplus.pl11
8 files changed, 111 insertions, 68 deletions
diff --git a/_data/scripts.yaml b/_data/scripts.yaml
index 7ba9490..51b4f5c 100644
--- a/_data/scripts.yaml
+++ b/_data/scripts.yaml
@@ -103,11 +103,11 @@
description: 'Adds a permanent advanced window list on the right or in a status bar.'
filename: adv_windowlist.pl
license: 'GNU GPLv2 or later'
- modified: '2016-11-01 17:15:32'
+ modified: '2017-04-03 21:21:55'
modules: Text::CharWidth
name: adv_windowlist
url: http://anti.teamidiot.de/
- version: '1.3'
+ version: '1.4'
-
authors: BC-bd
commands: ai
@@ -2722,11 +2722,11 @@
description: 'Localizes users using traceroute, the localizer database or IP-Atlas'
filename: localize.pl
license: GPLv2
- modified: '2014-12-06 11:57:45'
+ modified: '2017-04-01 17:22:26'
modules: 'HTML::Entities LWP::UserAgent'
name: localize
url: ''
- version: '2014112501'
+ version: '2017040101'
-
authors: 'Peder Stray'
contact: peder@ninja.no
@@ -3900,10 +3900,10 @@
description: 'Turns irssi into a quiz bot'
filename: quiz.pl
license: GPLv2
- modified: '2002-04-24 01:12:01'
+ modified: '2017-04-03 14:51:40'
name: Quiz
url: http://the.earth.li/~huggie/irssi/
- version: '0.7'
+ version: '0.8'
-
authors: 'Athanasius Emilius Arvanitis based on Simon Huggins quiz 0.7'
contact: arvan
@@ -3921,10 +3921,10 @@
description: 'Un script de quiz pour irssi'
filename: quizmaster-fr.pl
license: GPLv2
- modified: '2008-06-16 10:15:05'
+ modified: '2017-04-03 18:52:16'
name: quizmaster
url: 'http://irssi.org/scripts/ http://pierre.carlot.free.fr/tux/'
- version: 20030208+fr
+ version: 20170403+fr
-
authors: "Stefan 'tommie' Tomanek"
commands: quizmaster
@@ -3932,10 +3932,10 @@
description: 'a trivia script for Irssi'
filename: quizmaster.pl
license: GPLv2
- modified: '2008-06-16 10:14:51'
+ modified: '2017-04-03 18:05:34'
name: quizmaster
url: http://irssi.org/scripts/
- version: '20030208'
+ version: '20170403'
-
authors: 'Jakub Jankowski'
commands: 'rkick rknockout rme rsay rtopic'
@@ -4564,10 +4564,10 @@
description: 'Linux system information (with vPenis and other stuff)'
filename: sysinfoplus.pl
license: 'Public Domain'
- modified: '2002-11-04 15:17:30'
+ modified: '2017-04-02 20:30:12'
name: SysinfoPlus
url: http://juerd.nl/irssi/
- version: '2.20'
+ version: '2.21'
-
authors: "Stefan 'tommie' Tomanek"
contact: stefan@pico.ruhr.de
diff --git a/_testing/config.yml b/_testing/config.yml
index 6263fde..012305b 100644
--- a/_testing/config.yml
+++ b/_testing/config.yml
@@ -45,18 +45,13 @@ whitelist:
- isdn
- ixmmsa
- l33tmusic
- - localize
- log2ansi
- mkshorterlink
- newsline
- oidenty
- 'on'
- osd
- - quizmaster-fr
- - quizmaster
- - quiz
- stocks
- - sysinfoplus
- tvmusor
- wordcompletition
- xetra
diff --git a/scripts/adv_windowlist.pl b/scripts/adv_windowlist.pl
index 6285786..d656eef 100644
--- a/scripts/adv_windowlist.pl
+++ b/scripts/adv_windowlist.pl
@@ -1,7 +1,7 @@
use strict;
use warnings;
-our $VERSION = '1.3'; # 463402cffae35e5
+our $VERSION = '1.4'; # b46fded611292cb
our %IRSSI = (
authors => 'Nei',
contact => 'Nei @ anti@conference.jabber.teamidiot.de',
@@ -79,6 +79,9 @@ our %IRSSI = (
# * string : Character to use when shortening long names. The second character
# will be used if two blocks need to be filled.
#
+# /format awl_title <string>
+# * string : Text to display in the title string or title bar
+#
# /format awl_viewer_item_bg <string>
# * string : Format String specifying the viewer's item background colour
#
@@ -398,7 +401,19 @@ sub syncLines {
my ($item, $get_size_only) = @_;
my $text = $actString[0];
- my $pat = defined $text ? '{sb '.ucfirst(setc()).': $*}' : '{sb }';
+ my $title = _get_format(set 'title');
+ if (length $title) {
+ $title =~ s{\\(.)|(.)}{
+ defined $2 ? quotemeta $2
+ : $1 eq 'V' ? '\u'
+ : $1 eq ':' ? quotemeta ':%n'
+ : $1 =~ /^[uUFQE]$/ ? "\\$1"
+ : quotemeta "\\$1"
+ }sge;
+ $title = eval qq{"$title"};
+ $title .= ' ';
+ }
+ my $pat = defined $text ? "{sb $title\$*}" : '{sb }';
$text //= '';
$item->default_handler($get_size_only, $pat, $text, 0);
};
@@ -454,6 +469,12 @@ sub awl {
}
}
+sub _add_map {
+ my ($type, $target, $map) = @_;
+ ($type->{$target}) = sort { length $a <=> length $b || $a cmp $b }
+ $map, exists $type->{$target} ? $type->{$target} : ();
+}
+
sub get_keymap {
my ($textDest, undef, $cont_stripped) = @_;
if ($textDest->{level} == 524288 and $textDest->{target} eq '' and !defined $textDest->{server}) {
@@ -472,32 +493,32 @@ sub get_keymap {
for ($command) {
last unless length $map;
if (/^change_window (\d+)/i) {
- $nummap{$1} = $map;
+ _add_map(\%nummap, $1, $map);
}
- elsif (/^command window goto (\S+)/i) {
+ elsif (/^(?:command window goto|change_window) (\S+)/i) {
my $window = $1;
if ($window !~ /\D/) {
- $nummap{$window} = $map;
+ _add_map(\%nummap, $window, $map);
}
elsif (lc $window eq 'active') {
- $specialmap{_active} = $map;
+ _add_map(\%specialmap, '_active', $map);
}
else {
- $wnmap{$window} = $map;
+ _add_map(\%wnmap, $window, $map);
}
}
elsif (/^(?:active_window|command (ack))/i) {
- $specialmap{_active} = $map;
+ _add_map(\%specialmap, '_active', $map);
$viewer{use_ack} = !!$1;
}
elsif (/^command window last/i) {
- $specialmap{_last} = $map;
+ _add_map(\%specialmap, '_last', $map);
}
elsif (/^(?:upper_window|command window up)/i) {
- $specialmap{_up} = $map;
+ _add_map(\%specialmap, '_up', $map);
}
elsif (/^(?:lower_window|command window down)/i) {
- $specialmap{_down} = $map;
+ _add_map(\%specialmap, '_down', $map);
}
elsif (/^key\s+(\w+)/i) {
$custom_key_map{$1} = $map;
@@ -726,12 +747,16 @@ sub _format_display {
@ret
}
+sub _get_format {
+ Irssi::current_theme->get_format(__PACKAGE__, @_)
+}
+
sub _calculate_items {
my ($wins, $abbrevList) = @_;
- my $display_header = Irssi::current_theme->get_format(__PACKAGE__, set 'display_header');
- my $name_format = Irssi::current_theme->get_format(__PACKAGE__, set 'name_display');
- my $abbrev_chars = as_uni(Irssi::current_theme->get_format(__PACKAGE__, set 'abbrev_chars'));
+ my $display_header = _get_format(set 'display_header');
+ my $name_format = _get_format(set 'name_display');
+ my $abbrev_chars = as_uni(_get_format(set 'abbrev_chars'));
my %displays;
@@ -767,14 +792,14 @@ sub _calculate_items {
$abbrev2 = $abbrev_chars[1];
}
for my $win (@$wins) {
- my $global_hack_alert_tag_header;
+ my $global_tag_header_mode;
next unless ref $win;
my $backup_win = Storable::dclone($win);
delete $backup_win->{active} unless ref $backup_win->{active};
- $global_hack_alert_tag_header =
+ $global_tag_header_mode =
$display_header && ($last_net // '') ne ($backup_win->{active}{server}{tag} // '');
if ($win->{data_level} < abs $S{hide_data}
@@ -796,7 +821,7 @@ sub _calculate_items {
my $number = $win->{refnum};
my ($name, $display, $cdisplay);
- if ($global_hack_alert_tag_header) {
+ if ($global_tag_header_mode) {
$display = $display_header;
$name = as_uni($backup_win->{active}{server}{tag}) // '';
if ($custom_xform) {
@@ -818,7 +843,7 @@ sub _calculate_items {
grep { !/_visible$/ } @display;
}
$display = (grep { length $_ }
- map { $displays{$_} //= Irssi::current_theme->get_format(__PACKAGE__, set $_) }
+ map { $displays{$_} //= _get_format(set $_) }
@display)[0];
$cdisplay = $name_format;
$name = as_uni($win->get_active_name) // '';
@@ -906,7 +931,7 @@ sub _calculate_items {
as_tc($key_ent),
$win);
- if ($global_hack_alert_tag_header) {
+ if ($global_tag_header_mode) {
$last_net = $backup_win->{active}{server}{tag};
redo;
}
@@ -917,9 +942,9 @@ sub _calculate_items {
sub _spread_items {
my $width = [Irssi::windows]->[0]{width} - $sb_base_width - 1;
- my @separator = Irssi::current_theme->get_format(__PACKAGE__, set 'separator');
+ my @separator = _get_format(set 'separator');
if ($S{block} >= 0) {
- my $sep2 = Irssi::current_theme->get_format(__PACKAGE__, set 'separator2');
+ my $sep2 = _get_format(set 'separator2');
push @separator, $sep2 if length $sep2 && $sep2 ne $separator[0];
}
$separator[0] .= '%n';
@@ -929,7 +954,7 @@ sub _spread_items {
my $curLine;
my $curLen = 0;
if ($S{shared_sbar}) {
- $curLen += $S{shared_sbar}[0] + 2 + length setc();
+ $curLen += $S{shared_sbar}[0] + 2;
$width -= $S{shared_sbar}[2];
}
my $mouse_header_check = 0;
@@ -1198,13 +1223,25 @@ sub syncViewer {
});
$viewer{client_env} = 1;
}
- my $separator = Irssi::current_theme->get_format(__PACKAGE__, set 'separator');
+ my $separator = _get_format(set 'separator');
my $sepLen = sb_length($separator);
- my $item_bg = Irssi::current_theme->get_format(__PACKAGE__, set 'viewer_item_bg');
+ my $item_bg = _get_format(set 'viewer_item_bg');
+ my $title = _get_format(set 'title');
+ if (length $title) {
+ $title =~ s{\\(.)|(.)}{
+ defined $2 ? quotemeta $2
+ : $1 eq 'V' ? '\U'
+ : $1 eq ':' ? quotemeta '%N'
+ : $1 =~ /^[uUFQE]$/ ? "\\$1"
+ : quotemeta "\\$1"
+ }sge;
+ $title = eval qq{"$title"};
+ }
$str .= _encode_var(redraw => 1) if delete $viewer{fullRedraw};
$str .= _encode_var(separator => $separator,
seplen => $sepLen,
itembg => $item_bg,
+ title => $title,
mouse => $mouse_coords{refnum},
key2 => \%wnmap_exp,
win => \@win_items);
@@ -1377,9 +1414,9 @@ return sub {
%banned_channels = map { lc1459(to_uni($_)) => undef }
split ' ', Irssi::settings_get_str('banned_channels');
- my @sb_base = split /\177/, sb_format_expand("{sb \177}"), 2;
+ my @sb_base = split /\177/, sb_format_expand("{sbstart}{sb \177}{sbend}"), 2;
$sb_base_width_pre = sb_length($sb_base[0]);
- $sb_base_width_post = sb_length($sb_base[1]);
+ $sb_base_width_post = max 0, sb_length($sb_base[1])-1;
$sb_base_width = $sb_base_width_pre + $sb_base_width_post;
if ($print_text_activity && $S{line_shade}) {
@@ -1602,6 +1639,7 @@ Irssi::signal_register({
set 'separator2' => '',
set 'abbrev_chars' => "~\x{301c}",
set 'viewer_item_bg' => sb_format_expand('{sb_background}'),
+ set 'title' => '\V'.setc().'\:',
]);
}
Irssi::settings_add_bool(setc, set 'prefer_name', 0); #
@@ -1976,13 +2014,17 @@ UNITCHECK
}
sub _header {
- my $str = uc ::setc();
- my $space = int( ((abs $vars{block}) - length $str) / (1 + length $str));
+ my $str = $vars{title} // uc ::setc();
+ my $ccs = qr/%(?:X(?:[1-6][0-9A-Z]|7[A-X])|[0-9BCFGIKMNRUWY_])/i;
+ (my $stripstr = $str) =~ s/($ccs)//g;
+ my $space = int( ((abs $vars{block}) - length $stripstr) / (1 + length $stripstr));
if ($space > 0) {
my $ss = ' ' x $space;
- $str = join $ss, '', (split //, $str), '';
+ my @x = $str =~ /((?:$ccs)*\X(?:(?:$ccs)*$)?)/g;
+ $str = join $ss, '', @x, '';
}
- my $pad = (abs $vars{block}) - length $str;
+ ($stripstr = $str) =~ s/($ccs)//g;
+ my $pad = max 0, (abs $vars{block}) - length $stripstr;
$str = ' ' x ($pad/2) . $str . ' ' x ($pad/2 + $pad%2);
$str
}
@@ -2017,7 +2059,7 @@ UNITCHECK
my $j = 0;
my @new_screen;
my @new_mouse;
- $new_screen[0][0] = _header() . ' ' x $vars{seplen}
+ $new_screen[0][0] = _header() #. ' ' x $vars{seplen}
if $show_title_bar;
unless ($nrows > $ncols) { # line layout
++$j if $show_title_bar;
@@ -2393,6 +2435,11 @@ UNITCHECK
# Changelog
# =========
+# 1.4
+# - fix line wrapping in some themes, reported by justanotherbody
+# - fix named window key detection, reported by madduck
+# - make title (in viewer and shared_sbar) configurable
+#
# 1.3 - workaround for irssi issue #572
# 1.2 - new format to choose abbreviation character
# 1.1 - infinite loop on shortening certain window names reported by Kalan
diff --git a/scripts/localize.pl b/scripts/localize.pl
index 7aabe9f..b836c92 100644
--- a/scripts/localize.pl
+++ b/scripts/localize.pl
@@ -60,7 +60,7 @@
use strict;
use vars qw($VERSION %IRSSI);
-$VERSION = "2014112501";
+$VERSION = "2017040101";
%IRSSI = (
authors => "Stefan 'tommie' Tomanek",
contact => "stefan\@pico.ruhr.de",
@@ -511,7 +511,7 @@ sub save_cache {
my $filename = Irssi::settings_get_str('localize_cache_filename');
my $data = Dumper(\%cache);
local *F;
- open(F, '>'.$filename);
+ open(F, '>',$filename);
print(F $data);
close(F);
print CLIENTCRAP "%R>>%n localize cache (".scalar(keys(%cache))." entries/".length($data)." bytes) saved to ".$filename;
@@ -522,7 +522,7 @@ sub load_cache {
my $filename = Irssi::settings_get_str('localize_cache_filename');
my (%new_cache, $text);
local *F;
- open F, "<".$filename || return;
+ open F, "<",$filename || return;
$text .= $_ foreach (<F>);
close(F);
eval { %new_cache = %{ eval "$text" }; };
@@ -561,7 +561,7 @@ sub show_map ($$$) {
my $cmd = Irssi::settings_get_str('localize_xplanet_cmd');
my $file = Irssi::settings_get_str('localize_xplanet_temp_file');
local *F;
- open F, '>'.$file;
+ open F, '>',$file;
print F $lat.' '.$long.' "'.$nick.'"';
close F;
system("$cmd -markerf $file &");
diff --git a/scripts/quiz.pl b/scripts/quiz.pl
index 09ae726..46e34d8 100644
--- a/scripts/quiz.pl
+++ b/scripts/quiz.pl
@@ -26,7 +26,7 @@ use strict;
use vars qw($VERSION %IRSSI);
use Irssi 20020217.1542 (); # Version 0.8.1
-$VERSION = "0.7";
+$VERSION = "0.8";
%IRSSI = (
authors => "Simon Huggins",
contact => "huggie-irssi\@earth.li",
@@ -34,7 +34,7 @@ name => "Quiz",
description => "Turns irssi into a quiz bot",
license => "GPLv2",
url => "http://the.earth.li/~huggie/irssi/",
-changed => "Wed Apr 24 01:12:01 BST 2002",
+changed => "2017-04-03",
);
use Irssi::Irc;
@@ -69,7 +69,7 @@ sub load_questions($$) {
return if $game->{'questions'} and not $force;
my $file = Irssi::settings_get_str("quiz_file");
- if (open(QS, "<$file")) {
+ if (open(QS, '<',$file)) {
@{$game->{'questions'}}=<QS>;
close(QS);
Irssi::print("Loaded questions");
diff --git a/scripts/quizmaster-fr.pl b/scripts/quizmaster-fr.pl
index 1f5bd7b..c143a09 100644
--- a/scripts/quizmaster-fr.pl
+++ b/scripts/quizmaster-fr.pl
@@ -3,7 +3,7 @@
use strict;
use vars qw($VERSION %IRSSI);
-$VERSION = '20030208+fr';
+$VERSION = '20170403+fr';
%IRSSI = (
authors => 'Stefan \'tommie\' Tomanek',
contact => 'stefan@pico.ruhr.de',
@@ -60,7 +60,7 @@ sub draw_box ($$$$) {
sub save_quizfile {
local *F;
my $filename = Irssi::settings_get_str("quizmaster_questions_file");
- open(F, ">".$filename);
+ open(F, '>',$filename);
my $dumper = Data::Dumper->new([\%questions], ['quest']);
$dumper->Purity(1)->Deepcopy(1);
my $data = $dumper->Dump;
@@ -75,7 +75,7 @@ sub load_quizfile ($) {
return unless -e $file;
my $text;
local *F;
- open F, $file;
+ open F,'<', $file;
$text .= $_ foreach (<F>);
close F;
return unless "$text";
@@ -85,7 +85,7 @@ sub load_quizfile ($) {
sub import_quizfile ($$) {
my ($name, $file) = @_;
local *F;
- open(F, $file);
+ open(F,'<', $file);
my @data = <F>;
my @questions;
my $quest = {};
diff --git a/scripts/quizmaster.pl b/scripts/quizmaster.pl
index 5aec557..e226075 100644
--- a/scripts/quizmaster.pl
+++ b/scripts/quizmaster.pl
@@ -2,7 +2,7 @@
use strict;
use vars qw($VERSION %IRSSI);
-$VERSION = '20030208';
+$VERSION = '20170403';
%IRSSI = (
authors => 'Stefan \'tommie\' Tomanek',
contact => 'stefan@pico.ruhr.de',
@@ -59,7 +59,7 @@ sub draw_box ($$$$) {
sub save_quizfile {
local *F;
my $filename = Irssi::settings_get_str("quizmaster_questions_file");
- open(F, ">".$filename);
+ open(F, ">",$filename);
my $dumper = Data::Dumper->new([\%questions], ['quest']);
$dumper->Purity(1)->Deepcopy(1);
my $data = $dumper->Dump;
@@ -74,7 +74,7 @@ sub load_quizfile ($) {
return unless -e $file;
my $text;
local *F;
- open F, $file;
+ open F,'<', $file;
$text .= $_ foreach (<F>);
close F;
return unless "$text";
@@ -84,7 +84,7 @@ sub load_quizfile ($) {
sub import_quizfile ($$) {
my ($name, $file) = @_;
local *F;
- open(F, $file);
+ open(F,'<', $file);
my @data = <F>;
my @questions;
my $quest = {};
diff --git a/scripts/sysinfoplus.pl b/scripts/sysinfoplus.pl
index cc82d0d..fc0cff0 100644
--- a/scripts/sysinfoplus.pl
+++ b/scripts/sysinfoplus.pl
@@ -16,8 +16,10 @@
# -Total amount of memory counts (not the used amount, as before)
# Changelog 2.10 -> 2.20: memory/swap info is displayed now (it was broken previously) and code is properly indented
+use strict;
+use vars qw/$VERSION %IRSSI/;
-$VERSION = "2.20";
+$VERSION = "2.21";
%IRSSI = (
authors => "Juerd, Tronic",
contact => "trn\@iki.fi",
@@ -25,7 +27,7 @@ $VERSION = "2.20";
description => "Linux system information (with vPenis and other stuff)",
license => "Public Domain",
url => "http://juerd.nl/irssi/",
- changed => "Mon Nov 04 15:17:30 EET 2002"
+ changed => "2017-04-02"
);
BEGIN{
@@ -37,7 +39,6 @@ BEGIN{
$console = !!$@;
}
-use strict;
# Tronic has no time for maintaining this and Juerd hates braces, so it might be better
# not to expect any new versions ...
@@ -51,7 +52,7 @@ sub sysinfo{
$ret = "Host '@uname[1]', running @uname[0] @uname[2] - ";
- open FOO, '/proc/cpuinfo';
+ open FOO,'<', '/proc/cpuinfo';
while (<FOO>){
/^processor\s*:\s*(\d+)/ ? $ret .= "Cpu$1: "
: /^model name\s*:\s*(\w+[ A-Za-z]*)/ ? do { my $t = $1; $t =~ s/\s+$//; $ret .= "$t " }
@@ -60,7 +61,7 @@ sub sysinfo{
}
close FOO;
$ret =~ s/( ?)$/;$1/;
- open FOO, '/proc/pci';
+ open FOO,'<', '/proc/pci';
while (<FOO>){
/^\s*(?:multimedia )?(.*?)( storage| compatible)? controller/i and push @pci, $1;
}