#!/usr/bin/perl
# prints current exaile track in xchat
# by Rainer Hihn ( rainer@hihn.org ) 

use strict;

my ($name,$version,$desc);

$name = "xep - XChat Exaile Printer";
$version = "0.2";
$desc = "Prints the current Exaile track in XChat";

Xchat::register($name, $version, $desc);
Xchat::hook_command('exaile', \&exaile);

sub exaile {
    my ($title,@title);
    $title  = `exaile --get-artist --get-title --get-album`;
    @title = split("\n", $title);

	Xchat::command("me is listening to '".$title[1]." - ".$title[0]."' from '".$title[2]."'");
	return Xchat::EAT_NONE;
}

