#!/bin/sh # usage: xroot [-c COLOR] [IMAGE-FILE] bg_path="$HOME/lib/xpm /usr/share/pixmaps/backgrounds \ /usr/share/pixmaps/backgrounds/Propaganda" if [ -r $HOME/.xroot ]; then background="`cat $HOME/.xroot`" else background="" fi if [ $# -ge 1 ]; then background="$*" fi case "$background" in -c*) color=`echo "$background" | sed -e 's/-c //'` xsetroot -solid "$color" ;; *) if [ ! -r "$background" ]; then for d in $bg_path; do if [ -r $d/$background ]; then background="$d/$background" break fi done fi case "$background" in *.xpm) xpmroot "$background" ;; *) xsetbg "$background" ;; esac ;; esac echo "$background" >$HOME/.xroot