Wikia

Music Player Daemon Community Wiki

Watchlist Recent changes

Hack:prevtitle

  • Description: Small bash script which skips to the previous title if playtime of currently playing title lower than 10 s (time adjustable in script) else it seeks to begin of currently playing title.
  • Intended purpose: Skiping with LIRC or keyboard short keys
  • Additional info: Restore the behavior of older MPD versions (< v0.16).
  • Author: Fux77, inital version: 2010-08-01


  • Code
#!/bin/bash

# PARAMETER
TIME="0:10"

if [[ $(mpc --format %time% | head -n 1) -eq "" ]]; then # check if stream (no total-length)
	mpc prev
else
     if [[ $(mpc | grep "\[playing\]" | awk -F'   ' '{print $2}' | awk -F'/' '{print $1}') < "$TIME" ]]
     then
	     mpc prev
     else
	     mpc seek 0%
     fi
fi

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