From 6f8b29e1fa4d7c4f8676dbded0b9fde3e9acd207 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 1 Jun 2013 02:04:45 -0500 Subject: Add initial copy of the old Debian desktop-base package to the Debian and Ubuntu packaging files --- .../usplash/moreblue-orbit/themesetup.sh | 151 +++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100755 ubuntu/raring/defaultsettings/desktop-base/usplash/moreblue-orbit/themesetup.sh (limited to 'ubuntu/raring/defaultsettings/desktop-base/usplash/moreblue-orbit/themesetup.sh') diff --git a/ubuntu/raring/defaultsettings/desktop-base/usplash/moreblue-orbit/themesetup.sh b/ubuntu/raring/defaultsettings/desktop-base/usplash/moreblue-orbit/themesetup.sh new file mode 100755 index 000000000..81f0bd882 --- /dev/null +++ b/ubuntu/raring/defaultsettings/desktop-base/usplash/moreblue-orbit/themesetup.sh @@ -0,0 +1,151 @@ +#!/bin/sh + +# +# Sanity checks +# +if [ ! -e theme.in ]; then + exit 1 +fi + +if [ $# -lt 1 ]; then + exit 1 +fi + +# +# Helper functions +# +struct_name() { + name=${1%.*} + echo "pixmap_$name" +} + +# +# Begin processing +# + +echo "/*" +echo " * Part 1 - Generic header part" +echo " */" +cat theme.in +echo + + + +echo "/*" +echo " * Part 2 - Forward theme struct declarations" +echo " */" +first=yes +for size in $@; do + if [ $first = "yes" ]; then + THEMENAME="usplash_theme" + first=no + else + THEMENAME="usplash_theme_$size" + fi + echo "struct usplash_theme $THEMENAME;" +done +echo + + + +echo "/*" +echo " * Step 3 - Actual theme struct defs" +echo " */" +first=yes +while [ 1 ]; do + size="$1" + if [ -z "$size" ]; then + exit 0 + fi + + if [ $first = "yes" ]; then + THEMENAME="usplash_theme" + first=no + else + THEMENAME="usplash_theme_$size" + fi + + if [ -z "$2" ]; then + THEMENEXT="NULL" + else + THEMENEXT="&usplash_theme_$2" + fi + shift + + PGFG_PIX="progressfg_$size.png" + PGFG_STRUCT=$(struct_name "$PGFG_PIX") + PGBG_PIX="progressbg_$size.png" + PGBG_STRUCT=$(struct_name "$PGBG_PIX") + BG_PIX="background_$size.png" + BG_STRUCT=$(struct_name "$BG_PIX") + + PROGRESS_WIDTH=$( identify "$PGFG_PIX" | cut -d' ' -f3 | cut -dx -f1) + PROGRESS_HEIGHT=$( identify "$PGFG_PIX" | cut -d' ' -f3 | cut -dx -f2) + WIDTH=${size%x*} + HEIGHT=${size#*x} + + if [ $(( $WIDTH / 16 )) -eq $(( $HEIGHT / 9 )) ]; then + RATIO="USPLASH_16_9" + else + RATIO="USPLASH_4_3" + fi + + cat <