Fandom

Music Player Daemon Community Wiki

Hack:Mpc-relseek.pl

525pages on
this wiki
Add New Page
Talk0 Share

This script is obsolete because it's functionality is included to mpc-0.11.2

This perl-script allows you to seek backward/forward for particular time in seconds.

Usage:

mpc-relseek.pl <time>

<time> is time to seek in seconds. To seek backward, use negative values.

#!/usr/bin/perl

$status=`mpc`;

$delta_t=$ARGV[0] || "5";

if($status=~/\[playing\] +\#\d+\/\d+ +(\d+):(\d+) \((\d+)\%\)/)
{
       $percent=$3/100;
       $time_secs=$1*60+$2;

       $alltime=$time_secs/$percent;

       $newtime=$time_secs+$delta_t;
       $newpercent=int($newtime/$alltime*100);
       system("mpc seek $newpercent");
}

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.