From: Gregory Colpart Date: Wed, 1 Apr 2020 03:29:42 +0000 (+0200) Subject: add new script : unread.pl (small script to reset a window to unread status) X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=03962d143125fe3f79ac06d9e4200f49493ce9de;p=irssi-scripts.irssi.org.git add new script : unread.pl (small script to reset a window to unread status) --- diff --git a/scripts/unread.pl b/scripts/unread.pl new file mode 100644 index 0000000..ddc2181 --- /dev/null +++ b/scripts/unread.pl @@ -0,0 +1,26 @@ +#!/usr/bin/perl +# reset window to unread status + +use strict; +use vars qw($VERSION %IRSSI); +use Irssi; +$VERSION = '0.1'; +%IRSSI = ( + authors => 'Gregory Colpart', + contact => 'reg on #evolix@freenode', + name => 'unread', + description => 'reset window to unread status', + license => 'GPLv2 or later', + changed => '2020-04-01' +); + +# copy unread.pl to ~/.irssi/scripts/ +# /load unread.pl +# /unread + +Irssi::command_bind 'unread' => sub { + my ( $data, $server, $item ) = @_; + $data =~ s/\s+$//g; + Irssi::window_find_refnum($data)->activity(3); +}; +