|
|
ae8a10 |
#!/bin/bash
|
|
|
ae8a10 |
#
|
|
|
ab1d67 |
# render_doDm.sh -- This function collects Display Manager (DM)
|
|
|
ce597a |
|
|
|
ce597a |
# together. Use this function as last-rendition action for Gdm and Kdm
|
|
|
ce597a |
# base-rendition actions.
|
|
|
eb0e14 |
#
|
|
|
7cd8e9 |
# Usage:
|
|
|
eb0e14 |
#
|
|
|
fa95b1 |
# ACTIONS[1]='LAST:renderDm:TYPE:RESOLUTION'
|
|
|
eb0e14 |
#
|
|
|
7cd8e9 |
# Where:
|
|
|
eb0e14 |
#
|
|
|
fa95b1 |
# TYPE can be either `Gdm' or `Kdm'. These values correspond to the
|
|
|
fa95b1 |
# directory names used to store related design models.
|
|
|
eb0e14 |
#
|
|
|
fa95b1 |
|
|
|
fa95b1 |
# produced for (e.g., 800x600, 1024x768, 2048x1536, etc.).
|
|
|
eb0e14 |
#
|
|
|
d856c1 |
# In order to produce tar.gz files correctly, both screen resolution
|
|
|
d856c1 |
# definition inside pre-rendition configuration script and background
|
|
|
d856c1 |
# name inside theme directory structure need to match one another. If
|
|
|
d856c1 |
|
|
|
d856c1 |
# background information for it, the related tar.gz file is not
|
|
|
d856c1 |
|
|
|
d856c1 |
# evaluated.
|
|
|
ae8a10 |
#
|
|
|
9f5f2e |
# Copyright (C) 2009-2011 Alain Reguera Delgado
|
|
|
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.
|
|
|
ae8a10 |
# ----------------------------------------------------------------------
|
|
|
ae8a10 |
# $Id$
|
|
|
ae8a10 |
# ----------------------------------------------------------------------
|
|
|
ae8a10 |
|
|
|
ab1d67 |
function render_doDm {
|
|
|
ae8a10 |
|
|
|
d856c1 |
local -a SRC
|
|
|
d856c1 |
local -a DST
|
|
|
eb0e14 |
local DM=''
|
|
|
d856c1 |
local TGZ=''
|
|
|
d856c1 |
local COUNT=0
|
|
|
d856c1 |
local RESOLUTION=''
|
|
|
d856c1 |
local RESOLUTIONS=''
|
|
|
ae8a10 |
|
|
|
8af4d8 |
# Print separator line.
|
|
|
8af4d8 |
cli_printMessage '-' 'AsSeparatorLine'
|
|
|
8af4d8 |
|
|
|
15b1d2 |
# Get display manager passed from render.conf.sh pre-rendition
|
|
|
ae8a10 |
|
|
|
ab1d67 |
DM=$(render_getConfigOption "${ACTION}" '2')
|
|
|
643925 |
|
|
|
d856c1 |
# Sanitate display manager passed from render.conf.sh
|
|
|
d856c1 |
|
|
|
d856c1 |
|
|
|
643925 |
# uppercase in order to match either Gdm or Kdm design model
|
|
|
d856c1 |
|
|
|
643925 |
DM=$(cli_getRepoName "$DM" 'd')
|
|
|
ae8a10 |
|
|
|
15b1d2 |
# Get screen resolutions passed from render.conf.sh pre-rendition
|
|
|
eb0e14 |
|
|
|
ab1d67 |
RESOLUTIONS=$(render_getConfigOption "${ACTION}" '3')
|
|
|
ae8a10 |
|
|
|
d856c1 |
# Check screen resolutions passed from render.conf.sh
|
|
|
d856c1 |
|
|
|
eb0e14 |
if [[ "$RESOLUTIONS" == '' ]];then
|
|
|
07c2fe |
cli_printMessage "`gettext "There is no resolution information to process."`" 'AsErrorLine'
|
|
|
eee226 |
cli_printMessage "${FUNCDIRNAM}" "AsToKnowMoreLine"
|
|
|
ae8a10 |
fi
|
|
|
ae8a10 |
|
|
|
d856c1 |
|
|
|
d1b3f5 |
SRC[0]=$(cli_getRepoTLDir)/Identity/Brands/Img/symbol-resized-48.png
|
|
|
643925 |
SRC[1]=${OUTPUT}/release.png
|
|
|
643925 |
SRC[2]=${OUTPUT}/screenshot.png
|
|
|
86c3d1 |
SRC[3]=$(dirname $TEMPLATE)/GdmGreeterTheme.xml
|
|
|
86c3d1 |
SRC[4]=$(dirname $TEMPLATE)/GdmGreeterTheme.desktop
|
|
|
d856c1 |
SRC[5]=$(cli_getRepoTLDir)/Identity/Themes/Motifs/$(cli_getPathComponent '--theme')/Backgrounds/Img/Png
|
|
|
86c3d1 |
SRC[6]=$(dirname $TEMPLATE)/icon-language.png
|
|
|
86c3d1 |
SRC[7]=$(dirname $TEMPLATE)/icon-reboot.png
|
|
|
86c3d1 |
SRC[8]=$(dirname $TEMPLATE)/icon-session.png
|
|
|
86c3d1 |
SRC[9]=$(dirname $TEMPLATE)/icon-shutdown.png
|
|
|
d856c1 |
|
|
|
d856c1 |
|
|
|
d856c1 |
TGZ=$(cli_getPathComponent '--theme-name')
|
|
|
d856c1 |
|
|
|
d856c1 |
|
|
|
d856c1 |
DST[0]=${TGZ}/centos-symbol.png
|
|
|
d856c1 |
DST[1]=${TGZ}/centos-release.png
|
|
|
d856c1 |
DST[2]=${TGZ}/screenshot.png
|
|
|
d856c1 |
DST[3]=${TGZ}/${TGZ}.xml
|
|
|
d856c1 |
DST[4]=${TGZ}/GdmGreeterTheme.desktop
|
|
|
d856c1 |
DST[5]=${TGZ}/background.png
|
|
|
d856c1 |
DST[6]=${TGZ}/icon-language.png
|
|
|
d856c1 |
DST[7]=${TGZ}/icon-reboot.png
|
|
|
d856c1 |
DST[8]=${TGZ}/icon-session.png
|
|
|
d856c1 |
DST[9]=${TGZ}/icon-shutdown.png
|
|
|
d856c1 |
|
|
|
d856c1 |
|
|
|
643925 |
pushd ${OUTPUT} > /dev/null
|
|
|
d856c1 |
|
|
|
d856c1 |
|
|
|
d856c1 |
if [[ ! -d ${TGZ} ]];then
|
|
|
d856c1 |
mkdir ${TGZ}
|
|
|
eb0e14 |
fi
|
|
|
ae8a10 |
|
|
|
d856c1 |
for RESOLUTION in $RESOLUTIONS;do
|
|
|
d991f5 |
|
|
|
d856c1 |
while [[ $COUNT -lt ${#SRC[*]} ]];do
|
|
|
ae8a10 |
|
|
|
d856c1 |
if [[ $COUNT -eq 5 ]];then
|
|
|
ae8a10 |
|
|
|
d856c1 |
|
|
|
d856c1 |
|
|
|
d856c1 |
SRC[$COUNT]=$(echo "${SRC[$COUNT]}" | cut -d/ -f-13)/${RESOLUTION}-final.png
|
|
|
ae8a10 |
|
|
|
d856c1 |
|
|
|
d856c1 |
|
|
|
d856c1 |
|
|
|
d856c1 |
|
|
|
d856c1 |
|
|
|
d856c1 |
if [[ ! -f ${SRC[$COUNT]} ]];then
|
|
|
d856c1 |
continue 2
|
|
|
d856c1 |
fi
|
|
|
d856c1 |
|
|
|
d856c1 |
elif [[ $COUNT =~ '^[6-9]$' ]];then
|
|
|
ae8a10 |
|
|
|
643925 |
# If display manager is Kdm, then increment counter and
|
|
|
643925 |
|
|
|
d856c1 |
|
|
|
643925 |
if [[ $DM =~ '^Kdm$' ]];then
|
|
|
d856c1 |
COUNT=$(($COUNT + 1))
|
|
|
d856c1 |
continue
|
|
|
d856c1 |
fi
|
|
|
ae8a10 |
|
|
|
d856c1 |
fi
|
|
|
eb0e14 |
|
|
|
d856c1 |
|
|
|
d856c1 |
cli_checkFiles ${SRC[$COUNT]}
|
|
|
ae8a10 |
|
|
|
d856c1 |
|
|
|
d856c1 |
cp ${SRC[$COUNT]} ${DST[$COUNT]}
|
|
|
ae8a10 |
|
|
|
d856c1 |
|
|
|
d856c1 |
|
|
|
d856c1 |
if [[ $COUNT =~ '^(3|4)$' ]];then
|
|
|
79e54d |
cli_replaceTMarkers "${DST[$COUNT]}"
|
|
|
8b5668 |
fi
|
|
|
ae8a10 |
|
|
|
d856c1 |
|
|
|
d856c1 |
COUNT=$(($COUNT + 1))
|
|
|
ae8a10 |
|
|
|
d856c1 |
done
|
|
|
ae8a10 |
|
|
|
d856c1 |
|
|
|
d856c1 |
COUNT=0
|
|
|
ae8a10 |
|
|
|
643925 |
|
|
|
643925 |
cli_printMessage "${OUTPUT}/${RESOLUTION}.tar.gz" "AsCreatingLine"
|
|
|
ae8a10 |
|
|
|
d856c1 |
|
|
|
d856c1 |
tar -czf "${RESOLUTION}.tar.gz" $TGZ
|
|
|
ae8a10 |
|
|
|
d856c1 |
done
|
|
|
ae8a10 |
|
|
|
d856c1 |
|
|
|
d856c1 |
|
|
|
d856c1 |
rm -r $TGZ
|
|
|
ae8a10 |
|
|
|
d856c1 |
|
|
|
d856c1 |
cli_printMessage "${SRC[1]}" "AsDeletingLine"
|
|
|
d856c1 |
rm ${SRC[1]}
|
|
|
d856c1 |
cli_printMessage "${SRC[2]}" "AsDeletingLine"
|
|
|
d856c1 |
rm ${SRC[2]}
|
|
|
ec641d |
|
|
|
d856c1 |
|
|
|
d856c1 |
popd > /dev/null
|
|
|
d856c1 |
|
|
|
ae8a10 |
}
|