XBMC Boxee UI Switcher

I bind this script to a button on my LIRC remote to easily switch between XBMC and Boxee on my HTPC. XBMC’s interface using the Rapier skin and fanart is much more attractive, but Boxee offers great social network integration (read: Youtube).

#/bin/bash
# Switch between XBMC and Boxee
if ps ax | grep -v grep | grep xbmc.bin > /dev/null
then
	echo "XBMC running, killing process"
	kill `pidof xbmc.bin`
	sleep 7
	echo "running Boxee"
	/usr/bin/runBoxee &
elif ps ax | grep -v grep | grep Boxee > /dev/null
then
	echo "Boxee running, killing process"
	kill `pidof Boxee`
	sleep 7
	echo "running XBMC"
	/usr/bin/runXBMC &
else
	echo "No UI running, starting XBMC"
	/usr/bin/runXBMC &
fi

Start irexec daemon

Compile Mplayer

Use this script to compile the latest version of mplayer in Ubuntu and save yourself some headaches. Resolving compile dependencies in Ubuntu is daunting at best, especially when you’re dealing with multimedia apps. You might end up with some unneeded dependencies, but it’s better than resolving them individually when the configure commands complain.

Could not embed GitHub Gist 615286: Not Found

Resize Album Art

I use this to scale and crop my higher quality album art for embedding in my audio tags.

#!/bin/bash
# aa.sh
# Scale and crop album art for embedding in music tags

if [ -z $1 ]
	then
		echo "Usage: `basename $0` image_file"
else
	convert $1 -resize 300x300^ -gravity center -extent 300x300 folder.jpg
fi