Fandom

Music Player Daemon Community Wiki

Hack:Jump to file from console

525pages on
this wiki
Add New Page
Talk0 Share

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.

This is a hack bashmp and it requires mpc to work, it allows you to jump to a file from the console based on regexp to find the song you are looking for:

#!/bin/bash

function sJump () {
  if [ -z = $1 ]; then
    echo "Missing parameters"
    echo "Usage: sJump <autor> <song-title>"
    echo "You may use regexp on both parameters"
    echo "To list all artist's song use ? en <song-title>"
  elif [ -z = $2 ]; then
    echo "Missing parameters"
    echo "Usage: sJump <autor> <song-title>"
    echo "You may use regexp on both parameters"
    echo "To list all artist's song use ? en <song-title>"
  else
    SONGS=`mpc playlist | egrep -i $1 | egrep -i $2 | awk '1 {print $1-1+1}'`
    cont=1;
    for foo in $SONGS
    do
      let cont=$cont+1
    done
    if [ $cont -lt 2 ]; then
      mpc play $SONG --no-status
    else
      SONGS=`mpc playlist | egrep -i $1 | egrep -i $2`
      echo -e "$SONGS"
      echo -n "Ingrese el numero de  la canción a la que desea saltar :: "
      read -e wSong
      mpc play $wSong --no-status
    fi
  fi
}

Add this to your .bashrc

Also on Fandom

Random Wiki