| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function render_svg_convertPngToDm { |
| |
| |
| cli_printMessage '-' --as-separator-line |
| |
| |
| local SRC='' |
| local DST='' |
| |
| |
| local DM=$(render_getConfigOption "${ACTION}" '2') |
| |
| |
| |
| local RESOLUTION='' |
| local RESOLUTIONS=$(render_getConfigOption "${ACTION}" '3') |
| |
| |
| |
| if [[ "$RESOLUTIONS" == '' ]];then |
| cli_printMessage "`gettext "There is no resolution information to process."`" --as-error-line |
| fi |
| |
| |
| |
| local THEME=$(cli_getPathComponent $ACTIONVAL --motif) |
| local THEME_NAME=$(cli_getPathComponent $ACTIONVAL --motif-name) |
| |
| |
| |
| |
| |
| local TMPDIR=$(cli_getTemporalFile 'dm') |
| |
| |
| |
| |
| local BRANDS=$(cli_getRepoTLDir)/Identity/Images/Brands |
| |
| |
| |
| |
| local BGS=$(cli_getRepoTLDir)/Identity/Images/Themes/${THEME}/Backgrounds/Img/Png |
| |
| |
| |
| local FILE='' |
| local FILES='' |
| |
| |
| |
| |
| |
| |
| case ${DM} in |
| |
| Gdm ) |
| FILES="\ |
| ${BRANDS}/centos-symbol-resized-48.png:centos-symbol.png |
| ${OUTPUT}/release.png:centos-release.png |
| ${OUTPUT}/screenshot.png:screenshot.png |
| $(dirname $TEMPLATE)/GdmGreeterTheme.xml:${THEME_NAME}.xml |
| $(dirname $TEMPLATE)/GdmGreeterTheme.desktop:GdmGreeterTheme.desktop |
| $(dirname $TEMPLATE)/icon-language.png:icon-language.png |
| $(dirname $TEMPLATE)/icon-reboot.png:icon-reboot.png |
| $(dirname $TEMPLATE)/icon-session.png:icon-session.png |
| $(dirname $TEMPLATE)/icon-shutdown.png:icon-shutdown.png |
| " |
| ;; |
| |
| Kdm ) |
| FILES="\ |
| ${BRANDS}/centos-symbol-resized-48.png:centos-symbol.png |
| ${OUTPUT}/release.png:centos-release.png |
| ${OUTPUT}/screenshot.png:screenshot.png |
| $(dirname $TEMPLATE)/GdmGreeterTheme.xml:${THEME_NAME}.xml |
| $(dirname $TEMPLATE)/GdmGreeterTheme.desktop:GdmGreeterTheme.desktop |
| " |
| ;; |
| |
| * ) |
| cli_printMessage "`eval_gettext "The \\\"\\\$DM\\\" display manager is not supported yet."`" --as-error-line |
| ;; |
| esac |
| |
| for FILE in $FILES;do |
| |
| # Define source location. |
| SRC=$(echo $FILE | cut -d: -f1) |
| |
| # Define target location. |
| DST=${TMPDIR}/${THEME_NAME}/$(echo $FILE | cut -d: -f2) |
| |
| # Verify source files. |
| cli_checkFiles $SRC |
| |
| # Verify parent directory for target file. |
| if [[ ! -d $(dirname $DST) ]];then |
| mkdir -p $(dirname $DST) |
| fi |
| |
| # Copy files from source to target location. |
| cp ${SRC} ${DST} |
| |
| # Expand translation markers. |
| if [[ ${DST} =~ "\.(xml|desktop)$" ]];then |
| cli_replaceTMarkers "${DST}" |
| fi |
| |
| done |
| |
| # Move into temporal directory. |
| pushd $TMPDIR > /dev/null |
| |
| for RESOLUTION in $RESOLUTIONS;do |
| |
| # Verify background information. If it doesn't exist go on |
| # with the next one in the list. |
| if [[ ! -f $BGS/${RESOLUTION}-final.png ]];then |
| continue |
| fi |
| |
| # Print action message. |
| if [[ -f ${RESOLUTION}.tar.gz ]];then |
| cli_printMessage "${OUTPUT}/${RESOLUTION}.tar.gz" --as-updating-line |
| else |
| cli_printMessage "${OUTPUT}/${RESOLUTION}.tar.gz" --as-creating-line |
| fi |
| |
| # Copy background information. |
| cp $BGS/${RESOLUTION}-final.png ${THEME_NAME}/background.png |
| |
| # Create tar.gz file. |
| tar -czf ${RESOLUTION}.tar.gz ${THEME_NAME} |
| |
| # Move from temporal directory to its final location. |
| mv ${RESOLUTION}.tar.gz ${OUTPUT} |
| |
| done |
| |
| # Return to where we were initially. |
| popd > /dev/null |
| |
| # Remove temporal directory. |
| rm -r ${TMPDIR} |
| |
| } |
| |