- 0 Talk
-
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, $_; }; }