Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 27 lines (18 sloc) 514 Bytes
#!/usr/bin/perl
use strict;
use warnings;
use Net::DBus;
use Sys::Hostname;
if (hostname ne 'zombie') {
exec "ssh zombie DISPLAY=:0 exec ~/bin/np";
}
my $bus = Net::DBus->session
or die "Can't connect to dbus session";
my $srv = $bus->get_service("org.kde.amarok")
or die "Can't get service";
my $obj = $srv->get_object("/Player")
or die "Can't get player object";
my $md = $obj->GetMetadata
or die "Can't get metadata";
printf "%s - %s (%s, %i)\n",
map {$_ //=""} @$md{qw/artist title album year/};