123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- #! /bin/bash
- themename_stem="ComixCursors"
- configfile_dir="${themename_stem}Configs"
- configfile_template_name="Custom"
- bindir="$(dirname $0)"/bin
- ICONSDIR=${ICONSDIR:-~/.icons}
- export ICONSDIR
- export MULTISIZE=true
- function show_usage_message {
- cat <<_EOT_
- Usage: $0 [option]
- Install the ComixCursors mouse theme.
- Options:
- -h: Display this help text, then exit.
- -u: Uninstall the ComixCursors mouse theme.
- -v: Be verbose.
- _EOT_
- }
- while getopts ":uhv" opt; do
- case $opt in
- h)
- show_usage_message
- exit
- ;;
- u)
- UNINSTALL=true
- ;;
- v)
- export VERBOSE=true
- ;;
- *)
- printf "Unexpected option: -%s\n" "$OPTARG" >&2
- show_usage_message
- exit 2
- ;;
- esac
- done
- function build_theme {
-
- THEMENAME="$1"
- export THEMENAME
- if [ $UNINSTALL ]; then
- make uninstall
- else
- if [ ${MULTISIZE} ] ; then
- printf "\nBuilding \"${THEMENAME}${THEMEOPTIONS}${THEMEINCLUDE}\" (multisize)\n"
- "${bindir}"/build-cursors
- if [ $VERBOSE ] ; then
- make
- make install
- else
- make -s
- make -s install
- fi
- else
-
- configfile="${configfile_dir}/${THEMENAME}.CONFIG"
- source "${configfile}"
- for SIZENAMES in ${SIZES[@]} ; do
- export SIZENAME="-${SIZENAMES%%=*}"
- export CURSORSIZE=${SIZENAMES##*=}
- printf "\nBuilding \"${THEMENAME}${THEMEOPTIONS}${THEMEINCLUDE}${SIZENAME}\"\n"
- "${bindir}"/build-cursors
- if [ $VERBOSE ] ; then
- make
- make install
- else
- make -s
- make -s install
- fi
- done
- fi
- fi
- }
- function build_include_theme {
- themename="$1"
-
- export ORIENTATION="RightHanded"
- export THEMEOPTIONS=""
- build_theme "$themename"
-
- export ORIENTATION="LeftHanded"
- export THEMEOPTIONS="-LH"
- build_theme "$themename"
- }
- for configfile in "${configfile_dir}"/*.CONFIG ; do
-
- configfile_name=$(basename "$configfile")
- themename="${configfile_name%.CONFIG}"
- if [ "$themename" == "$configfile_template_name" ]; then
-
- continue
- fi
- unset THEMEINCLUDE
- build_include_theme "$themename"
- for includefile in "${configfile_dir}"/*.INCLUDE ; do
- includefile_name=$(basename "$includefile")
- export THEMEINCLUDE="-${includefile_name%.INCLUDE}"
- build_include_theme "$themename"
- done
- done
- exit 0
|