#!/bin/csh -f #H# This uses xv to set the wallpaper to the cover of whatever CD is playing. #H# If no cover image exists it reverts to plain black. # print usage info if needed if ($1 != "") exec sed -n -e '/^\#H\#/s/^....//p' $0 # Give me an early default of solid black xsetroot -solid black # Pause for a second to make sure that xmms actually has something open sleep 1 # Find out what is currently playing and the directory that it is in. set FileName=`xmmsctrl print %F` set FullDir=`realpath "$FileName"` set Dir=`dirname "$FullDir"` # Command line to use to set the wallpaper set Displayer="xloadimage -onroot -fullscreen -border black" # Go into the dir that may have the pictures cd "$Dir" # Attempt to set the wallpaper to several different standard filenames. # If none are found just leave it black. $Displayer *Cover.* || $Displayer *Inlay.* || $Displayer *Inside.* || $Displayer *Back.* || $Displayer *Disc.* || $Displayer *.jpg || $Displayer *.png