/usr/share/irssi/scripts/licq.pl is in irssi-scripts 20131030.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | $VERSION = "0.5";
%IRSSI = (
authors => "Jari Matilainen",
contact => "jmn98015\@student.mdh.se",
name => "licq",
description => "Licq statusbar thingy",
license => "Public Domain",
url => "http://jari.cjb.net,http://irssi.org,http://scripts.irssi.de",
);
use Irssi::TextUI;
my $result;
my $refresh_tag;
my $rdir = "$ENV{'HOME'}/.licq/users/";
sub licq {
my ($item,$get_size_only) = @_;
$result = 0;
if(-e $rdir) {
opendir(DIR, $rdir);
while ( $_ = readdir(DIR) ) {
next if(($_ eq ".") or ($_ eq ".."));
my $filename = "$rdir" . "$_";
if(-e $filename) {
open(FILE, $filename);
$_ = "";
$_ = <FILE> until /NewMessages/;
my @total = split / /, $_;
if(defined $total[2]) {
$result += $total[2];
}
}
}
}
closedir(DIR);
$item->default_handler($get_size_only, undef, $result, 1);
}
sub refresh_licq {
Irssi::statusbar_items_redraw('licq');
}
sub init_licq {
my $time = Irssi::settings_get_int('licq_refresh_time');
$rdir = Irssi::settings_get_str('licq_path');
Irssi::timeout_remove($refresh_tag) if ($refresh_tag);
$refresh_tag = Irssi::timeout_add($time*1000, 'refresh_licq', undef);
}
Irssi::settings_add_int('LICQ','licq_refresh_time',10);
Irssi::settings_add_str('LICQ','licq_path',$rdir);
Irssi::statusbar_item_register('licq', '{sb ICQ: $0-}', 'licq');
init_licq();
Irssi::signal_add('setup changed','init_licq');
refresh_licq();
# EOF
|