4 # Part of ComixCursors, a desktop cursor theme.
6 # Copyright © 2010 Ben Finney <ben+gnome@benfinney.id.au>
7 # Copyright © 2006–2010 Jens Luetkens <j.luetkens@hamburg.de>
9 # This work is free software: you can redistribute it and/or modify it
10 # under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
14 # This work is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this work. If not, see <http://www.gnu.org/licenses/>.
22 # Build and install all the ComixCursors themes.
24 themename_stem
="ComixCursors"
25 configfile_dir
="${themename_stem}Configs"
26 configfile_template_name
="custom"
28 bindir
="$(dirname $0)"/bin
30 # Set the ICONSDIR destination to a default (if not already set).
31 ICONSDIR
=${ICONSDIR:-~/.icons}
34 # argument processing and usage
35 function show_usage_message
{
39 Install the ComixCursors mouse theme.
42 -h: Display this help text, then exit.
43 -u: Uninstall the ComixCursors mouse theme.
48 while getopts ":uh" opt
; do
58 printf "Unexpected option: -%s\n" "$OPTARG" >&2
65 function build_theme
{
66 # Build the cursors for a particular theme.
69 destdir
="${ICONSDIR}/${themename_stem}-${THEMENAME}"
70 if [ -d "${destdir}" ] ; then
75 if [ $UNINSTALL ] ; then
78 printf "\nBuilding \"${THEMENAME}\":\n\n"
79 "${bindir}"/build-cursors
85 for configfile
in "${configfile_dir}"/*.CONFIG
; do
86 # Each config file represents a theme to be built.
87 configfile_name
=$
(basename "$configfile")
88 themename
="${configfile_name%.CONFIG}"
89 if [ "$themename" == "$configfile_template_name" ] ; then
90 # The template isn't a theme we want to build.
93 build_theme
"$themename"