- authors => 'BC-bd, Veli',
- contact => 'bd@bc-bd.org, veli@piipiip.net',
- name => 'chanact',
- description => 'Adds new powerful and customizable [Act: ...] item (chanelnames,modes,alias). Lets you give alias characters to windows so that you can select those with meta-<char>',
- license => 'GNU GPLv2 or later',
- url => 'http://bc-bd.org/blog/irssi/'
+ authors => 'BC-bd, Veli',
+ contact => 'bd@bc-bd.org, veli@piipiip.net',
+ name => 'chanact',
+ description => 'Adds new powerful and customizable [Act: ...] item (chanelnames,modes,alias). Lets you give alias characters to windows so that you can select those with meta-<char>',
+ license => 'GNU GPLv2 or later',
+ url => 'http://bc-bd.org/blog/irssi/'
-# veli@piipiip.net /window_alias code
-# qrczak@knm.org.pl chanact_abbreviate_names
-# qerub@home.se Extra chanact_show_mode and chanact_chop_status
-# madduck@madduck.net Better channel aliasing (case-sensitive, cross-network)
+# veli@piipiip.net /window_alias code
+# qrczak@knm.org.pl chanact_abbreviate_names
+# qerub@home.se Extra chanact_show_mode and chanact_chop_status
+# madduck@madduck.net Better channel aliasing (case-sensitive, cross-network)
# Jan 'jast' Krueger <jast@heapsort.de>, 2004-06-22
# Ivo Timmermans <ivo@o2w.nl> win->{hilight} patch
# Jan 'jast' Krueger <jast@heapsort.de>, 2004-06-22
# Ivo Timmermans <ivo@o2w.nl> win->{hilight} patch
#
# After these steps you have your new statusbar item and you can start giving
# aliases to your windows. Go to the window you want to give the alias to
#
# After these steps you have your new statusbar item and you can start giving
# aliases to your windows. Go to the window you want to give the alias to
#
# /set chanact_display <string>
# * string : Format String for one Channel. The following $'s are expanded:
#
# /set chanact_display <string>
# * string : Format String for one Channel. The following $'s are expanded:
# /set chanact_display_alias <string>
# as 'chanact_display' but is used if the window has an alias and
# 'chanact_show_alias' is set to on.
# /set chanact_display_alias <string>
# as 'chanact_display' but is used if the window has an alias and
# 'chanact_show_alias' is set to on.
# /set chanact_show_names <ON|OFF>
# * ON : show the channelnames after the number/alias
# * OFF : don't show the names
#
# /set chanact_abbreviate_names <int>
# /set chanact_show_names <ON|OFF>
# * ON : show the channelnames after the number/alias
# * OFF : don't show the names
#
# /set chanact_abbreviate_names <int>
-# * 0 : don't abbreviate
-# * <int> : strip channel name prefix character and leave only
-# that many characters of the proper name
+# * 0 : don't abbreviate
+# * <int> : strip channel name prefix character and leave only
+# that many characters of the proper name
#
# /set chanact_show_alias <ON|OFF>
# * ON : show the aliase instead of the refnum
# * OFF : shot the refnum
#
# /set chanact_header <str>
#
# /set chanact_show_alias <ON|OFF>
# * ON : show the aliase instead of the refnum
# * OFF : shot the refnum
#
# /set chanact_header <str>
#
# /set chanact_separator <str>
# * <str> : Charater to use between the channel entries
#
# /set chanact_autorenumber <ON|OFF>
# * ON : Move the window automatically to first available slot
#
# /set chanact_separator <str>
# * <str> : Charater to use between the channel entries
#
# /set chanact_autorenumber <ON|OFF>
# * ON : Move the window automatically to first available slot
-# starting from "chanact_renumber_start" when assigning
-# an alias to window. Also moves the window back to a
-# first available slot from refnum 1 when the window
-# loses it's alias.
+# starting from "chanact_renumber_start" when assigning
+# an alias to window. Also moves the window back to a
+# first available slot from refnum 1 when the window
+# loses it's alias.
-# * <int> : Move the window to first available slot after this
-# num when "chanact_autorenumber" is ON.
+# * <int> : Move the window to first available slot after this
+# num when "chanact_autorenumber" is ON.
-# * <string> : Regular expression used to remove from the
-# beginning of the channel name.
-# * example :
-# To shorten a lot of debian channels:
-#
-# /set chanact_remove_prefix deb(ian.(devel-)?)?
+# * <string> : Regular expression used to remove from the
+# beginning of the channel name.
+# * example :
+# To shorten a lot of debian channels:
+#
+# /set chanact_remove_prefix deb(ian.(devel-)?)?
-# * 0 : show all channels
-# * 1 : hide channels without activity
-# * 2 : hide channels with only join/part/etc messages
-# * 3 : hide channels with text messages
-# * 4 : hide all channels (now why would you want to do that)
+# * 0 : show all channels
+# * 1 : hide channels without activity
+# * 2 : hide channels with only join/part/etc messages
+# * 3 : hide channels with text messages
+# * 4 : hide all channels (now why would you want to do that)
# If you have trouble with wrong colored entries your 'default.theme' might
# be too old. Try on a shell:
#
# If you have trouble with wrong colored entries your 'default.theme' might
# be too old. Try on a shell:
#
- my ($string, %format) = @_;
- my ($exp, $repl);
- $string =~ s/\$$exp/$repl/g while (($exp, $repl) = each(%format));
- return $string;
+ my ($string, %format) = @_;
+ my ($exp, $repl);
+ $string =~ s/\$$exp/$repl/g while (($exp, $repl) = each(%format));
+ return $string;
$item->default_handler($get_size_only, $actString, undef, 1);
}
# this is the real creation method
sub remake() {
my ($afternumber,$finish,$hilight,$mode,$number,$display,@windows);
$item->default_handler($get_size_only, $actString, undef, 1);
}
# this is the real creation method
sub remake() {
my ($afternumber,$finish,$hilight,$mode,$number,$display,@windows);
my $abbrev = Irssi::settings_get_int('chanact_abbreviate_names');
my $remove_prefix = Irssi::settings_get_str('chanact_remove_prefix');
my $remove_hash = Irssi::settings_get_bool('chanact_remove_hash');
my $abbrev = Irssi::settings_get_int('chanact_abbreviate_names');
my $remove_prefix = Irssi::settings_get_str('chanact_remove_prefix');
my $remove_hash = Irssi::settings_get_bool('chanact_remove_hash');
# (status) is an awfull long name, so make it short to 'S'
# some people don't like it, so make it configurable
if (Irssi::settings_get_bool('chanact_chop_status')
# (status) is an awfull long name, so make it short to 'S'
# some people don't like it, so make it configurable
if (Irssi::settings_get_bool('chanact_chop_status')
}
$actString .= expand($display,"C",$name,"N",$number,"M",$mode,"H",$hilight,"S","}{sb_background}").$separator;
}
$actString .= expand($display,"C",$name,"N",$number,"M",$mode,"H",$hilight,"S","}{sb_background}").$separator;
if (Irssi::settings_get_int('chanact_filter')) {
$actString = "{sb ".Irssi::settings_get_str('chanact_header').$actString."}";
} else {
if (Irssi::settings_get_int('chanact_filter')) {
$actString = "{sb ".Irssi::settings_get_str('chanact_header').$actString."}";
} else {
sub cmd_window_unalias {
my ($data, $server, $witem) = @_;
my $rn_start = Irssi::settings_get_int('chanact_renumber_start');
sub cmd_window_unalias {
my ($data, $server, $witem) = @_;
my $rn_start = Irssi::settings_get_int('chanact_renumber_start');
Irssi::active_win()->{name} =~ /^[a-zA-Z]$/) {
Irssi::print("Usage: /window_unalias <char>");
Irssi::print("or /window_alias in window that has an alias.");
return;
}
Irssi::active_win()->{name} =~ /^[a-zA-Z]$/) {
Irssi::print("Usage: /window_unalias <char>");
Irssi::print("or /window_alias in window that has an alias.");
return;
}
if ($data eq '') { $data = Irssi::active_win()->{name}; }
if (my $oldwin = Irssi::window_find_name($data)) {
$oldwin->set_name(undef);
Irssi::print("Removed alias with the key '$data'.");
if ($data eq '') { $data = Irssi::active_win()->{name}; }
if (my $oldwin = Irssi::window_find_name($data)) {
$oldwin->set_name(undef);
Irssi::print("Removed alias with the key '$data'.");
# Find the first available slot and move the window
my $newnum = 1;
while (Irssi::window_find_refnum($newnum) ne "") { $newnum++; }
$oldwin->set_refnum($newnum);
# Find the first available slot and move the window
my $newnum = 1;
while (Irssi::window_find_refnum($newnum) ne "") { $newnum++; }
$oldwin->set_refnum($newnum);
if (Irssi::settings_get_bool('chanact_autorenumber') == 1 &&
$window->{refnum} < $rn_start) {
my $old_refnum = $window->{refnum};
$winnum = $rn_start;
if (Irssi::settings_get_bool('chanact_autorenumber') == 1 &&
$window->{refnum} < $rn_start) {
my $old_refnum = $window->{refnum};
$winnum = $rn_start;
# Find the first available slot and move the window
while (Irssi::window_find_refnum($winnum) ne "") { $winnum++; }
$window->set_refnum($winnum);
# Find the first available slot and move the window
while (Irssi::window_find_refnum($winnum) ne "") { $winnum++; }
$window->set_refnum($winnum);
my $winname = $witem->{name};
my $winserver = $window->{active_server}->{tag};
my $winhandle = "$winserver/$winname";
my $winname = $witem->{name};
my $winserver = $window->{active_server}->{tag};
my $winhandle = "$winserver/$winname";
-# - fixed irssi crash when using Irssi::print from within remake()
-# - added option to filter out some data levels, based on a patch by
-# Juergen Jung <juergen@Winterkaelte.de>, see
-# https://bc-bd.org/trac/irssi/ticket/15
-# + retired chanact_show_all in favour of chanact_filter
+# - fixed irssi crash when using Irssi::print from within remake()
+# - added option to filter out some data levels, based on a patch by
+# Juergen Jung <juergen@Winterkaelte.de>, see
+# https://bc-bd.org/trac/irssi/ticket/15
+# + retired chanact_show_all in favour of chanact_filter
-# - changes by stefan voelkel
-# + sort channels by activity, see
-# https://bc-bd.org/trac/irssi/ticket/5, based on a patch by jan
-# krueger
-# + fixed chrash on /exec -interactive, see
-# https://bc-bd.org/trac/irssi/ticket/7
+# - changes by stefan voelkel
+# + sort channels by activity, see
+# https://bc-bd.org/trac/irssi/ticket/5, based on a patch by jan
+# krueger
+# + fixed chrash on /exec -interactive, see
+# https://bc-bd.org/trac/irssi/ticket/7
-# - changes by Jan 'jast' Krueger <jast@heapsort.de>, 2004-06-22
-# + updated documentation in script's comments
+# - changes by Jan 'jast' Krueger <jast@heapsort.de>, 2004-06-22
+# + updated documentation in script's comments
# - removed unused chanact_show_name settings (thx to Qerub)
# - fixed $mode display
# - guarded reference operations to (hopefully) fix errors on server disconnect
# - removed unused chanact_show_name settings (thx to Qerub)
# - fixed $mode display
# - guarded reference operations to (hopefully) fix errors on server disconnect
# - changed chanact_show_mode to chanact_display. reversed changes from
# Qerub through that, but kept funcionality.
# - removed chanact_color_all since it is no longer needed
# - changed chanact_show_mode to chanact_display. reversed changes from
# Qerub through that, but kept funcionality.
# - removed chanact_color_all since it is no longer needed