3 use vars qw($VERSION %IRSSI);
8 authors => 'Jeroen Coekaerts, Koenraad Heijlen',
9 contact => 'vipie@ulyssis.org, jeroen@coekaerts.be',
11 description => 'An OnScreenDisplay (osd) it show\'s who is talking to you, on what IRC Network.',
13 url => 'http://vipie.studentenweb.org/dev/irssi/',
14 changed => '2004-01-09'
18 #--------------------------------------------------------------------
20 #--------------------------------------------------------------------
23 #--------------------------------------------------------------------
25 #--------------------------------------------------------------------
33 Displays a small test message on screen
39 You can display on screen who is paging/msg'ing you on IRC.
41 When you CHANGE the settings you SHOULD use /osd_reload to let these changes
47 * osd_showactivechannel (default: yes)
48 Currently the setting is: " . Irssi::settings_get_str('osd_showactivechannel') . "
50 When set to yes, OSD will be triggered even if the channel is the active channel.
51 When set to yes, OSD will be triggered if you send a message from your own nick.
53 You can test the OSD settings with the 'osd_test' command!
54 he 'osd_test' to test them.
59 if ( $about =~ /(osd_reload|osd_test|osd)/i ) {
60 Irssi::print($myHELP{lc($1)});
64 #--------------------------------------------------------------------
66 #--------------------------------------------------------------------
68 Irssi::settings_add_str('OSD', 'osd_showactivechannel', "yes");
70 #--------------------------------------------------------------------
71 # initialize the pipe, test it.
72 #--------------------------------------------------------------------
75 osdprint("OSD Loaded.");
78 #--------------------------------------------------------------------
80 #--------------------------------------------------------------------
83 open(OSDPIPE, "| nc -q 1 localhost 1234 2>/dev/null");
84 OSDPIPE->autoflush(1);
87 #--------------------------------------------------------------------
88 # Private message parsing
89 #--------------------------------------------------------------------
92 my ($server,$msg,$nick,$address,$target) = @_;
93 osdprint("IRC:*private:$nick");
96 #--------------------------------------------------------------------
97 # Public message parsing
98 #--------------------------------------------------------------------
101 my ($server,$msg,$nick,$address, $channel) = @_;
104 if ($msg =~ /$server->{nick}/) {
105 osdprint("IRC:$channel:$nick");
109 #--------------------------------------------------------------------
110 # The actual printing
111 #--------------------------------------------------------------------
116 print OSDPIPE "$text\n";
121 #--------------------------------------------------------------------
123 #--------------------------------------------------------------------
126 osdprint("Testing OSD");
129 #--------------------------------------------------------------------
130 # Irssi::signal_add_last / Irssi::command_bind
131 #--------------------------------------------------------------------
133 Irssi::signal_add_last("message public", "pub_msg");
134 Irssi::signal_add_last("message private", "priv_msg");
136 Irssi::command_bind("osd_test","cmd_osd_test", "OSD");
137 Irssi::command_bind("help","cmd_help", "Irssi commands");
139 #--------------------------------------------------------------------
140 # The command that's executed at load time.
141 #--------------------------------------------------------------------
145 #--------------------------------------------------------------------
146 # This text is printed at Load time.
147 #--------------------------------------------------------------------
149 Irssi::print("Use /help osd for more information.");