Update wallpaper in fai scripts
authorUlrich Dangel <mru@grml.org>
Sun, 11 Dec 2011 14:44:31 +0000 (15:44 +0100)
committerChristian Hofstaedtler <ch@grml.org>
Sun, 11 Dec 2011 18:53:37 +0000 (19:53 +0100)
etc/grml/fai/config/scripts/GRMLBASE/47-update-wallpaper [new file with mode: 0755]
etc/grml/fai/config/scripts/RELEASE/99-update-wallpaper [new file with mode: 0755]

diff --git a/etc/grml/fai/config/scripts/GRMLBASE/47-update-wallpaper b/etc/grml/fai/config/scripts/GRMLBASE/47-update-wallpaper
new file mode 100755 (executable)
index 0000000..ca0a303
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/sh
+# Filename:      ${GRML_FAI_CONFIG}/config/scripts/GRMLBASE/47-update-wallpaper
+# Purpose:       Update the grml wallpaper
+# Authors:       grml-team (grml.org)
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2 or any later version.
+################################################################################
+
+. "$GRML_LIVE_CONFIG"
+
+FONTFILE=${FONTFILE:-/usr/share/grml-live/fonts/graphicoreBitmapFont0-Light.otf}
+TITLE_FONTSIZE=${TITLE_FONTSIZE:-200}
+VERSION_FONTSIZE=${VERSION_FONTSIZE:-100}
+GRML_BG=${GRML_BG:-$target/usr/share/grml/desktop-bg.png}
+GRML_WALLPAPER=${GRML_WALLPAPER:-$target/usr/share/grml/desktop.jpg}
+
+if [ ! -x "$(which convert)" ]; then
+  echo "convert not installed, skipping wallpaper."
+  exit 0
+fi
+
+echo "Creating standard wallpaper"
+
+convert "$GRML_BG" -gravity center \
+    -fill white -font "$FONTFILE" \
+    -pointsize $TITLE_FONTSIZE \
+    -draw "text 0,0 \"$GRML_NAME\"" \
+    -pointsize $VERSION_FONTSIZE \
+    -draw "text 0,$((TITLE_FONTSIZE+50)) \"$VERSION\"" "$GRML_WALLPAPER"
diff --git a/etc/grml/fai/config/scripts/RELEASE/99-update-wallpaper b/etc/grml/fai/config/scripts/RELEASE/99-update-wallpaper
new file mode 100755 (executable)
index 0000000..283f54f
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/sh
+# Filename:      ${GRML_FAI_CONFIG}/config/scripts/RELEASE/99-update-wallpaper
+# Purpose:       Update the grml wallpaper
+# Authors:       grml-team (grml.org)
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2 or any later version.
+################################################################################
+
+. "$GRML_LIVE_CONFIG"
+
+FONTFILE=${FONTFILE:-/usr/share/grml-live/fonts/graphicoreBitmapFont0-Light.otf}
+TITLE_FONTSIZE=${TITLE_FONTSIZE:-200}
+GRML_BG=${GRML_BG:-$target/usr/share/grml/desktop-bg.png}
+GRML_WALLPAPER=${GRML_WALLPAPER:-$target/usr/share/grml/desktop.jpg}
+
+echo "Creating release wallpaper"
+
+convert "$GRML_BG" -gravity center \
+    -fill white -font "$FONTFILE" \
+    -pointsize $TITLE_FONTSIZE \
+    -draw "text 0,0 \"$VERSION\"" "$GRML_WALLPAPER"
+