-
-error_msg()
-{
- case $INFO in yes|y|1) info_msg; esac
-
- case $1 in
- 1)
- echo; echo "$NAME: configuration error: $OPTION=\"$VALUE\""
- echo "$NAME: please edit $CONFIG and provide the correct variable."
- ;;
- 2)
- echo; echo "$NAME: error: couldn't execute '$APP'! tried to run fallback option $ARGUMENT"
- echo "$NAME: but quit because of the following error in $CONFIG:"
- echo "$NAME: $OPTION= $VALUE"
- echo "$NAME: please edit $CONFIG and provide the correct variable!"
- ;;
- 3)
- echo; echo "$NAME: error: couldn't find any suitable image applications in the system path!"
- echo
- error_msg url
- ;;
- 4)
- echo; echo "$NAME: error: invalid option, or non-existent image ($ARGUMENT)."
- ;;
- 5)
- echo; echo "$NAME: error: the image you specified ($IMAGE) could not be found."
- ;;
- 6)
- echo; echo "$NAME: error: please specify a valid image."
- ;;
- 7)
- echo; echo "$NAME: error: bsetroot couldn't be found! check your blackbox installation."
- ;;
- 8)
- echo; echo "$NAME: error: wrong number of arguments!"
- echo "$NAME: make sure you enclosed the options for '$APP' in double quotes."
- ;;
- nobgapp)
- echo; echo "$NAME: error: tried to run '$VALUE' for $ARGUMENT argument,"
- echo "$NAME: but couldnt find '$APP' in the path! please fix the following"
- echo "$NAME: line in $CONFIG to point to an existing application:"
- echo "$NAME: $OPTION=\"$VALUE\""
- ;;
- nogrep)
- echo "$NAME: error: couldn't find grep!"
- echo "this script needs grep to be in your path in order to function."
- echo "you can get GNU grep from ftp://ftp.gnu.org/bin/gnu/grep/" && exit 1
- ;;
- url)
- echo "it is suggested that you use qiv, xli (xsetbg), or xv."
- echo "you can obtain them at the following locations:"
- echo
- echo " qiv: http://www.klografx.de/software/qiv.shtml"
- echo " xli: http://pantransit.reptiles.org/prog/#xli"
- echo " xv: http://www.trilon.com/xv/downloads.html"
- echo
- echo "the above URLs are current as of 05/23/2000."
- esac
- exit 1
-}
-
-
-help_msg()
-{
- echo "$NAME $VERSION: $MORE"
- echo "options:"
- echo
- echo " (none) image is set using default values"
- echo
- echo " -full, -f image is set fullscreen"
- echo " -tile, -t image is set tiled"
- echo " -center, -c image is set centered"
- echo
- echo " -app, -a <application> image is set using <application> with"
- echo " <"'"application options"'"> quote-enclosed \"options\" and"
- echo " -center, -c|-tile, -t|-full, -f default fallback option"
- echo
- echo " -display <string> display to connect to (bsetroot only)"
- echo " -mod <x> <y> sets bsetroot modula pattern"
- echo " -foreground, -fg <color> modula foreground color"
- echo " -background, -bg <color> modula background color"
- echo
- echo " -gradient <texture> sets bsetroot gradient texture"
- echo " -from <color> gradient start color"
- echo " -to <color> gradient end color"
- echo
- echo " -solid <color> sets bsetroot solid color"
- echo
- echo " -version, -v outputs $NAME's version number"
- echo " -info, -i outputs configuration info"
- echo " -help, -h this message"
- echo
- echo "usage: <options...> <image>"
- exit 0
-}
-
-
-info_msg()
-{
- case $ERROR in
- [1-3])
- SUMMARY="error: some variables are blank"
- ;;
- 4)
- SUMMARY="no values have been specified"
- ;;
- 0)
- SUMMARY="looks good"
- esac
-
- case $APP_ERROR in [1-4])
- SUMMARY="error: some applications couldn't be found!"
- esac
-
- case `which bsetroot 2>&1` in
- */*bsetroot)
- BSETROOT=`which bsetroot`
- ;;
- *)
- BSETROOT="(error: not found)"
- case $ERROR in
- 1-4)
- SUMMARY="$SUMMARY, and bsetroot does not seem to be present."
- ;;
- *)
- SUMMARY="$SUMMARY, but bsetroot does not seem to be present."
- esac
- esac
-
- echo "$NAME $VERSION configuration:"
- echo
- echo " bsetroot: $BSETROOT"
- echo
- echo " reading configuration from: $CONFIG"
- echo
- echo " configuration values:"
- echo
- case $FULL_BGAPP_MSG in
- *"not found")
- echo " fullscreen (ERROR): $FULL_BGAPP_MSG"
- ;;
- *)
- echo " fullscreen (FULL): $FULL_MSG"
- esac
-
- echo
-
- case $TILE_BGAPP_MSG in
- *"not found")
- echo " tiled (ERROR): $TILE_BGAPP_MSG"
- ;;
- *)
- echo " tiled (TILE): $TILE_MSG"
- esac
-
- echo
-
- case $CENTER_BGAPP_MSG in
- *"not found")
- echo " centered (ERROR): $CENTER_BGAPP_MSG"
- ;;
- *)
- echo " centered (CENTER): $CENTER_MSG"
- esac
-
- echo
-
- case $DEFAULT_BGAPP_MSG in
- *"not found")
- echo " default (ERROR): $DEFAULT_BGAPP_MSG"
- ;;
- *)
- echo " default (DEFAULT): $DEFAULT_MSG"
- esac
- echo
- echo " summary: $SUMMARY"
- exit 0
+PATH=$PATH:/usr/bin:/usr/local/bin:/usr/X11R6/bin
+
+display_full_cmd="display -geometry 800x600 -window root"
+display_tile_cmd="display -window root"
+display_center_cmd="display -backdrop -window root"
+display_default_cmd="$display_center_cmd"
+
+Esetroot_full_cmd="Esetroot -scale"
+Esetroot_tile_cmd="Esetroot"
+Esetroot_center_cmd="Esetroot -c"
+Esetroot_default_cmd="$Esetroot_center_cmd"
+
+wmsetbg_full_cmd="wmsetbg -s -S"
+wmsetbg_tile_cmd="wmsetbg -t"
+wmsetbg_center_cmd="wmsetbg -e"
+wmsetbg_default_cmd="$wmsetbg_center_cmd"
+
+qiv_full_cmd="qiv --root_s"
+qiv_tile_cmd="qiv --root_t"
+qiv_center_cmd="qiv --root"
+qiv_default_cmd="$qiv_center_cmd"
+
+xv_full_cmd="xv -max -smooth -root -quit"
+xv_tile_cmd="xv -root -quit"
+xv_center_cmd="xv -rmode 5 -root -quit"
+xv_default_cmd="$xv_center_cmd"
+
+xli_full_cmd="xli -fullscreen -onroot -quiet"
+xli_tile_cmd="xli -onroot -quiet"
+xli_center_cmd="xli -center -onroot quiet"
+xli_default_cmd="$xli_center_cmd"
+
+xsetbg_full_cmd="xsetbg -fillscreen"
+xsetbg_tile_cmd="xsetbg"
+xsetbg_center_cmd="xsetbg -center"
+xsetbg_default_cmd="$xsetbg_center_cmd"
+
+img_apps="qiv xli xv wmsetbg Esetroot display xsetbg"
+me=${0##*/}
+version=2.0
+copyright="(c) 2000-$(date +%Y) by Timothy M. King (http://lordzork.com/)"
+config=$HOME/.bsetbgrc
+last_cmd_file=$HOME/.bsetbg_last_cmd
+refresh_cmd=xrefresh
+p=$me:
+
+quit() {
+ [ "$1" ] && rc=$1 && shift 1
+ [ "$*" ] && echo -e $*
+ exit ${rc:-0}