summaryrefslogtreecommitdiffstats
path: root/scripts/lwho.pl
blob: a821f9e1c6ee7153730d1715d3f50967a8507238 (plain)
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
# This script adds command /lwho that shows 
# locally logged users in current window

use strict;
use vars qw($VERSION %IRSSI);
$VERSION = '0.01a';
%IRSSI = (
 authors     => 'Mika',
 contact     => '[Mika] @ IRCnet',
 name        => 'Local who',
 description => 'Displays users logged on system in current window, simple one',
 license     => '-',
 url         => '-',
 changed     => 'none',
 bugs        => 'none?'
);


use Irssi;
use Sys::Hostname;

Irssi::command_bind('lwho' => sub {
        my $floodi = " ---- users logged on system \cB". hostname ."\cB";
        my $output = `w`;
        $floodi =~ s/ - $//;
        Irssi::active_win()->print("$floodi\n$output ----", MSGLEVEL_CRAP);
    }
);

Irssi::print("local who $VERSION by [Mika]");