Wikia

Music Player Daemon Community Wiki

Watchlist Recent changes

Hack:mpc-show-playlist

#!/usr/bin/perl
# mpc playlist wrapper, tested with mpc 0.18.
# License: GPLv3, see http://www.gnu.org/licenses/gpl.txt

use warnings;
use strict;

my $song = 0;
open(SONG, "mpc status |");
while(<SONG>) {
    #if(/\^+\] #(\d+)/) {
    if(/#(\d+)/) {
	$song = $1;
    }
}

#die unless defined($song);
my $n = 0;
open(PLAYLIST, "mpc playlist |");
while(<PLAYLIST>) {
    $n++;
    if($n==$song) {
	printf "\e[31;2m> %3d %s\e[31;0m", $n, $_;
    } else {
	printf "  %3d %s", $n, $_;
    };
}

Pages on Music Player Daemon Community Wiki

Add a Page
543pages on
this wiki
Advertisement | Your ad here

Latest Photos

Add a Photo
114photos on this wiki
See more >

Recent Wiki Activity

See more >

Around Wikia's network

Random Wiki