#!/bin/sh

mod=$1
if [ "$mod" = "" ] ; then
   mod=0
fi

#first, if a cd is playing, pause/unpause it 
case "$mod`cdinfo`" in
        0paused*)
                exec cdplay +
                ;;
        0play*)
                exec cdplay +
                ;;
        1no-status*)
                exec cdplay +
                ;;
esac

if [ "$mod" = "0" -o "$mod" = "1" ] ; then
        xmmsstatus=`xmmsstatus`
        if [ "$xmmsstatus" != none ] ; then
            exec xmms --fwd
        fi
fi

#if not, try getting xmms to unpause/pause the mp3 track


#if not, the last chance we have is to play a stopped cd. Nothing will happen if there is nothing in the cdplayer.
#if second modifier pressed, but xmms not running, try cd player again
cdplay +

