Re: [wmii] Fwd: script for wmii

From: Kris Maglione <bsdaemon_AT_comcast.net>
Date: Thu, 26 Jul 2007 14:47:50 -0400

On Thu, Jul 26, 2007 at 08:12:02PM +0200, Anselm R. Garbe wrote:
>#!/bin/sh
>IFS=$'\n'

This is a bashism, it's not nice to use such things and ask for
/bin/sh (my /bin/sh is certainly not bash (but... I have no
/bin/bash)).

It would be nice to know what mpccont does. Actually, I'm not
even sure of the purpose of this script.

> ...

#!/bin/sh -f
# Begin Configuration
MUSIC=/data/music
# End Condiguration

st=$({ echo .; echo ..; mpc ls $1;} | wmiimenu)

[ -z $st ] && exit

case $st in
        .) mpc clear
                mpc ls $1 | mpc add >/dev/null
                exec mpc play
                ;;
        ..) dir=$(dirname $1 | sed 's/^\.//')
                exec mpccont "$dir"
                ;;
esac

dir = "$MUSIC/$st"
ls "$dir" |
while read name; do
        if [ -d "$dir/$name" ]; then
                exec mpccont "$st"
        fi
done

mpc clear
mpc add "$st"
mpc play

-- 
Kris Maglione
RACF is a four letter word.

Received on Thu Jul 26 2007 - 20:48:23 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 16:26:22 UTC