|
|
ae8a10 |
#!/bin/bash
|
|
|
ae8a10 |
#
|
|
|
c2645e |
# render_svg_convertPngToDm.sh -- This function standardize production
|
|
|
c2645e |
# of display managers (e.g., Gdm and Kdm). This function copies all
|
|
|
c2645e |
|
|
|
c2645e |
|
|
|
c2645e |
# that is used for installation. This function must be used as
|
|
|
c2645e |
# last-rendition action for Gdm and Kdm directory specific
|
|
|
c2645e |
# base-rendition actions.
|
|
|
ae8a10 |
#
|
|
|
2d3646 |
# Copyright (C) 2009, 2010, 2011 The CentOS Project
|
|
|
fa95b1 |
#
|
|
|
fa95b1 |
# This program is free software; you can redistribute it and/or modify
|
|
|
fa95b1 |
|
|
|
dcd347 |
|
|
|
dcd347 |
|
|
|
fa95b1 |
#
|
|
|
74a058 |
|
|
|
74a058 |
|
|
|
ae8a10 |
|
|
|
ae8a10 |
# General Public License for more details.
|
|
|
ae8a10 |
#
|
|
|
ae8a10 |
|
|
|
ae8a10 |
# along with this program; if not, write to the Free Software
|
|
|
dcd347 |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
7ac5a5 |
#
|
|
|
ae8a10 |
# ----------------------------------------------------------------------
|
|
|
ae8a10 |
# $Id$
|
|
|
ae8a10 |
# ----------------------------------------------------------------------
|
|
|
ae8a10 |
|
|
|
c2645e |
function render_svg_convertPngToDm {
|
|
|
ae8a10 |
|
|
|
8af4d8 |
# Print separator line.
|
|
|
0ff158 |
cli_printMessage '-' --as-separator-line
|
|
|
8af4d8 |
|
|
|
44b2ba |
# Initialize source and destination local variables.
|
|
|
44b2ba |
local SRC=''
|
|
|
44b2ba |
local DST=''
|
|
|
ae8a10 |
|
|
|
44b2ba |
|
|
|
44b2ba |
local DM=$(render_getConfigOption "${ACTION}" '2')
|
|
|
ae8a10 |
|
|
|
44b2ba |
|
|
|
44b2ba |
|
|
|
44b2ba |
local RESOLUTION=''
|
|
|
44b2ba |
local RESOLUTIONS=$(render_getConfigOption "${ACTION}" '3')
|
|
|
ae8a10 |
|
|
|
44b2ba |
|
|
|
44b2ba |
# theme if no screen resolution has been specified.
|
|
|
44b2ba |
if [[ "$RESOLUTIONS" == '' ]];then
|
|
|
44b2ba |
cli_printMessage "`gettext "There is no resolution information to process."`" --as-error-line
|
|
|
44b2ba |
fi
|
|
|
ae8a10 |
|
|
|
44b2ba |
|
|
|
44b2ba |
|
|
|
334459 |
local THEME=$(cli_getPathComponent $ACTIONVAL --motif)
|
|
|
334459 |
local THEME_NAME=$(cli_getPathComponent $ACTIONVAL --motif-name)
|
|
|
44b2ba |
|
|
|
44b2ba |
|
|
|
44b2ba |
|
|
|
44b2ba |
# also needed in order to expand translation markers from XML and
|
|
|
44b2ba |
|
|
|
44b2ba |
local TMPDIR=$(cli_getTemporalFile 'dm')
|
|
|
44b2ba |
|
|
|
44b2ba |
|
|
|
44b2ba |
|
|
|
44b2ba |
|
|
|
44b2ba |
local BRANDS=$(cli_getRepoTLDir)/Identity/Images/Brands
|
|
|
44b2ba |
|
|
|
44b2ba |
|
|
|
44b2ba |
|
|
|
44b2ba |
|
|
|
44b2ba |
local BGS=$(cli_getRepoTLDir)/Identity/Images/Themes/${THEME}/Backgrounds/Img/Png
|
|
|
44b2ba |
|
|
|
44b2ba |
|
|
|
44b2ba |
|
|
|
44b2ba |
local FILE=''
|
|
|
44b2ba |
local FILES=''
|
|
|
44b2ba |
|
|
|
44b2ba |
|
|
|
44b2ba |
|
|
|
44b2ba |
|
|
|
44b2ba |
|
|
|
44b2ba |
|
|
|
44b2ba |
case ${DM} in
|
|
|
44b2ba |
|
|
|
44b2ba |
Gdm )
|
|
|
44b2ba |
FILES="\
|
|
|
44b2ba |
${BRANDS}/centos-symbol-resized-48.png:centos-symbol.png
|
|
|
44b2ba |
${OUTPUT}/release.png:centos-release.png
|
|
|
44b2ba |
${OUTPUT}/screenshot.png:screenshot.png
|
|
|
44b2ba |
$(dirname $TEMPLATE)/GdmGreeterTheme.xml:${THEME_NAME}.xml
|
|
|
44b2ba |
$(dirname $TEMPLATE)/GdmGreeterTheme.desktop:GdmGreeterTheme.desktop
|
|
|
44b2ba |
$(dirname $TEMPLATE)/icon-language.png:icon-language.png
|
|
|
44b2ba |
$(dirname $TEMPLATE)/icon-reboot.png:icon-reboot.png
|
|
|
44b2ba |
$(dirname $TEMPLATE)/icon-session.png:icon-session.png
|
|
|
44b2ba |
$(dirname $TEMPLATE)/icon-shutdown.png:icon-shutdown.png
|
|
|
44b2ba |
"
|
|
|
44b2ba |
|
|
|
44b2ba |
|
|
|
44b2ba |
Kdm )
|
|
|
44b2ba |
FILES="\
|
|
|
44b2ba |
${BRANDS}/centos-symbol-resized-48.png:centos-symbol.png
|
|
|
44b2ba |
${OUTPUT}/release.png:centos-release.png
|
|
|
44b2ba |
${OUTPUT}/screenshot.png:screenshot.png
|
|
|
44b2ba |
$(dirname $TEMPLATE)/GdmGreeterTheme.xml:${THEME_NAME}.xml
|
|
|
44b2ba |
$(dirname $TEMPLATE)/GdmGreeterTheme.desktop:GdmGreeterTheme.desktop
|
|
|
44b2ba |
"
|
|
|
44b2ba |
|
|
|
44b2ba |
|
|
|
44b2ba |
* )
|
|
|
44b2ba |
cli_printMessage "`eval_gettext "The \\\"\\\$DM\\\" display manager is not supported yet."`" --as-error-line
|
|
|
44b2ba |
|
|
|
44b2ba |
esac
|
|
|
44b2ba |
|
|
|
44b2ba |
for FILE in $FILES;do
|
|
|
44b2ba |
|
|
|
44b2ba |
|
|
|
44b2ba |
SRC=$(echo $FILE | cut -d: -f1)
|
|
|
44b2ba |
|
|
|
44b2ba |
|
|
|
44b2ba |
DST=${TMPDIR}/${THEME_NAME}/$(echo $FILE | cut -d: -f2)
|
|
|
44b2ba |
|
|
|
44b2ba |
|
|
|
44b2ba |
cli_checkFiles $SRC
|
|
|
44b2ba |
|
|
|
44b2ba |
|
|
|
44b2ba |
if [[ ! -d $(dirname $DST) ]];then
|
|
|
44b2ba |
mkdir -p $(dirname $DST)
|
|
|
44b2ba |
fi
|
|
|
eb0e14 |
|
|
|
44b2ba |
|
|
|
44b2ba |
cp ${SRC} ${DST}
|
|
|
ae8a10 |
|
|
|
44b2ba |
|
|
|
44b2ba |
if [[ ${DST} =~ "\.(xml|desktop)$" ]];then
|
|
|
44b2ba |
cli_replaceTMarkers "${DST}"
|
|
|
44b2ba |
fi
|
|
|
ae8a10 |
|
|
|
44b2ba |
done
|
|
|
ae8a10 |
|
|
|
44b2ba |
|
|
|
44b2ba |
pushd $TMPDIR > /dev/null
|
|
|
ae8a10 |
|
|
|
44b2ba |
for RESOLUTION in $RESOLUTIONS;do
|
|
|
ae8a10 |
|
|
|
44b2ba |
|
|
|
44b2ba |
|
|
|
44b2ba |
if [[ ! -f $BGS/${RESOLUTION}-final.png ]];then
|
|
|
44b2ba |
continue
|
|
|
44b2ba |
fi
|
|
|
ae8a10 |
|
|
|
643925 |
|
|
|
44b2ba |
if [[ -f ${RESOLUTION}.tar.gz ]];then
|
|
|
0ff158 |
cli_printMessage "${OUTPUT}/${RESOLUTION}.tar.gz" --as-updating-line
|
|
|
0ff158 |
else
|
|
|
0ff158 |
cli_printMessage "${OUTPUT}/${RESOLUTION}.tar.gz" --as-creating-line
|
|
|
0ff158 |
fi
|
|
|
ae8a10 |
|
|
|
44b2ba |
|
|
|
44b2ba |
cp $BGS/${RESOLUTION}-final.png ${THEME_NAME}/background.png
|
|
|
ae8a10 |
|
|
|
44b2ba |
|
|
|
44b2ba |
tar -czf ${RESOLUTION}.tar.gz ${THEME_NAME}
|
|
|
ae8a10 |
|
|
|
44b2ba |
|
|
|
44b2ba |
mv ${RESOLUTION}.tar.gz ${OUTPUT}
|
|
|
ae8a10 |
|
|
|
44b2ba |
done
|
|
|
ec641d |
|
|
|
d856c1 |
|
|
|
d856c1 |
popd > /dev/null
|
|
|
d856c1 |
|
|
|
44b2ba |
|
|
|
44b2ba |
rm -r ${TMPDIR}
|
|
|
44b2ba |
|
|
|
ae8a10 |
}
|