Feeds:
Posts
Comments

Archive for October, 2008

As with Amarok it’s not possible to delete the currently playing song in the MPD with any client I know. So again here’s my script. This time with a lot more error control 😉

#!/bin/bash
# Change this to your mpd music directory.
music_directory='/var/lib/mpd/music'
if ! mpc &> /dev/null
then
        echo "mpc wasn't found. Please install first."
        exit 1
fi
if [[ `mpc | wc -l` != 3 ]]
then
        echo 'There is no song playing right now...'
        exit 2
fi
if [[ -z $MUSICTRASH ]]
then
        echo 'Please set $MUSICTRASH.'
        echo '  For example add this line to your .bashrc:'
        echo '  export MUSICTRASH=~/music/.trash'
        exit 3
fi
if ! [[ -d $MUSICTRASH ]]
then
        echo "$MUSICTRASH does not exist."
        exit 4
fi
file=`mpc --format '%file%' | head -n1`
path="$music_directory/$file"
if [[ -f $path ]]
then
        name=`basename "$path"`
        mpc del 0
        mv "$path" "$MUSICTRASH/"
        echo "'$name' moved to '$MUSICTRASH'"
fi

Also set the config variable where you want to move your trashed music files:

File: .bashrc

export MUSICTRASH=~/music/.trash

Har!

TIP: Use xbindkeys if you need fast, easy and desktop-environment-independent global shortcuts.

Advertisements

Read Full Post »

Google 2001

Ever wondered what Google looked like in 2001? Look here. For it’s 10th birthday Google put the earliest index available back online 🙂

Examples:

Read Full Post »