Blame Scripts/Bash/Functions/Render/Config/Identity/Themes/Distro/rebrand-icon-themes.sh

4c79b5
#!/bin/bash
4c79b5
#
4c79b5
# Rebrand CentOS Icons in your local system using images from your
4c79b5
# working copy of the CentOS Artwork Repository. Run this script (as
4c79b5
# root) if you want to see how CentOS Icons, inside CentOS Artwork
4c79b5
# Repository, look in your system.
4c79b5
#
9f5f2e
# Copyright (C) 2009-2011 Alain Reguera Delgado
4c79b5
# 
4c79b5
# This program is free software; you can redistribute it and/or
4c79b5
# modify it under the terms of the GNU General Public License as
4c79b5
# published by the Free Software Foundation; either version 2 of the
4c79b5
# License, or (at your option) any later version.
4c79b5
# 
4c79b5
# This program is distributed in the hope that it will be useful, but
4c79b5
# WITHOUT ANY WARRANTY; without even the implied warranty of
4c79b5
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4c79b5
# General Public License for more details.
4c79b5
#
4c79b5
# You should have received a copy of the GNU General Public License
4c79b5
# along with this program; if not, write to the Free Software
4c79b5
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
4c79b5
# USA.
4c79b5
# 
4c79b5
# ----------------------------------------------------------------------
418249
# $Id$
4c79b5
# ----------------------------------------------------------------------
4c79b5
4c79b5
# Check user id.
4c79b5
if [ $UID -ne 0 ];then
4c79b5
   cli_printMessage "`gettext "You need to run this script as root user."`"
4c79b5
   exit
4c79b5
fi
4c79b5
4c79b5
SRC_LOGOS=~/artwork/trunk/Identity/Brands
4c79b5
WORKPLACE=$(pwd)
4c79b5
TRG='/usr/share/icons'
4c79b5
4c79b5
# Define file names which should contain the CentOS Brand, in this
4c79b5
# specific case the CentOS Symbol. Take care with the order in which
4c79b5
# you put files! Put more specific files first.
4c79b5
FILES='redhat-icon-panel-menu
4c79b5
       redhat-starthere 
4c79b5
       gnome-starthere 
4c79b5
       start-here
4c79b5
       kmenu'
4c79b5
4c79b5
for FILE in $FILES;do
4c79b5
4c79b5
   # Hold FILE's location.
4c79b5
   LOCATIONS=$(find $TRG/{Bluecurve,crystalsvg}/* \
4c79b5
      -regextype posix-egrep \
4c79b5
      -regex ".*/$FILE\.png")
4c79b5
4c79b5
   # Process each FILE location.
4c79b5
   for LOCATION in $LOCATIONS;do
4c79b5
4c79b5
      # Define FILE width.
4c79b5
      WIDTH=$(echo $LOCATION | cut -d/ -f6 | cut -dx -f1)
4c79b5
4c79b5
      # Define the appropriate source image.
4c79b5
      ICON=$SRC_LOGOS/Img/centos/symbol/5c-a/violet/$WIDTH.png
4c79b5
4c79b5
      # If ICON doesn't exist go to Logos section, render it, come
4c79b5
      # back here and continue.
4c79b5
      if [ ! -f $ICON ];then
4c79b5
         cd $SRC_LOGOS
4c79b5
         ./render.sh centos/symbol/5c-a/violet/$WIDTH
4c79b5
         cd $WORKPLACE
4c79b5
      fi
4c79b5
4c79b5
      # Rebrand LOCATION with the appropriate source image.
4c79b5
      if [ -f $LOCATION ] || [ -h $LOCATION ];then
4c79b5
         /bin/cp --remove-destination \
4c79b5
            --verbose \
4c79b5
            -Z system_u:object_r:usr_t \
4c79b5
            $ICON $LOCATION
4c79b5
     fi
4c79b5
   done
4c79b5
done
4c79b5
d43cfc
# TEMPLATE Files.
4c79b5
cp -v $SRC_LOGOS/Tpl/centos/symbols/kmenu.svgz \
4c79b5
   /usr/share/icons/crystalsvg/scalable/apps/kmenu.svgz
4c79b5