]> git.99rst.org Git - irssi-scripts.irssi.org.git/commitdiff
Added command_runsub glue
authorJari Matilainen <redacted>
Sun, 1 May 2016 19:05:08 +0000 (21:05 +0200)
committerJari Matilainen <redacted>
Sun, 1 May 2016 19:05:08 +0000 (21:05 +0200)
scripts/act.pl

index f7a752812cf6a8dc8b32dea75a29bf33323f4367..21cbbbbb8030cf569251c657c5398c28fbaae451 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 # resets window activity status
 #  by c0ffee 
 #    - http://www.penguin-breeder.org/irssi/
@@ -8,7 +8,7 @@ use strict;
 use vars qw($VERSION %IRSSI);
 
 use Irssi 20020120;
-$VERSION = "0.14";
+$VERSION = "0.15";
 %IRSSI = (
     authors    => "c0ffee",
     contact    => "c0ffee\@penguin-breeder.org",
@@ -30,7 +30,17 @@ $VERSION = "0.14";
 #
 # /ACT ALL sets all windows as non-active
 
-Irssi::command_bind('act', sub { _act(1); });
+Irssi::command_bind 'act' => sub {
+    my ( $data, $server, $item ) = @_;
+    $data =~ s/\s+$//g;
+    if ($data) {
+      Irssi::command_runsub('act', $data, $server, $item);
+    }
+    else {
+      _act(1);
+    }
+};
+
 Irssi::command_bind('act public', sub { _act(2); });
 Irssi::command_bind('act all', sub { _act(3); });
 
git clone https://git.99rst.org/PROJECT