Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 34 lines (26 sloc) 0.915 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
#!/bin/bash

# This example asks the user to pick a directory from ~/music or its
# first argument and queues up its contents via mpd. http://musicpd.org

music_home=${1:-"$HOME/music/"}

# Cache directory list
list_file="$music_home/.dirs"
if [ ! -f "$list_file" ]; then
    find "$music_home" -type d | cut -c $(echo $music_home | wc -c)- > "$list_file"
fi

# Ask the user
chosen=`cat $list_file | erythrina`

# Add it to mpd
if [ "$chosen" != "" ]; then
    mpc clear
    mpc add "$chosen"
    mpc play
fi

# You may find it helpful to bind these commands to keystrokes in
# addition to this script:

# notify-send "Now Playing" "`mpc | head -n 1`"

##!/usr/bin/env ruby
# current = `mpc`.split("\n").first
# playlist = `mpc playlist`.split("\n")
# current_index = playlist.index(current)
# rest = playlist[(current_index + 1) .. (current_index + 5)].join("\n")
# system "notify-send \"#{current}\" \"#{rest}\""
Something went wrong with that request. Please try again.