Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use Irssi;
- use Irssi::Irc;
- %IRSSI = (
- authors => "tm512",
- contact => "no",
- name => "np",
- description => "Now playing script for mpd",
- license => "wtfpl",
- url => "underhalls.net",
- );
- sub cmd_np
- {
- my $mpc_out = `mpc`;
- my @mpc_lines = split (/\n/, $mpc_out);
- my ($data, $server, $witem) = @_;
- if ($#mpc_lines == 0)
- {
- $witem->command ("ME \0034np:\003 \0035[stopped]");
- }
- else
- {
- $witem->command ("ME \002\0033np: \002".$mpc_lines[0]);
- }
- }
- Irssi::command_bind ('np', 'cmd_np');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement