Merge remote-tracking branch 'origin/github/pr/145'
[grml-live.git] / etc / grml / fai / config / scripts / RELEASE / 99-update-wallpaper
1 #!/bin/sh
2 # Filename:      ${GRML_FAI_CONFIG}/config/scripts/RELEASE/99-update-wallpaper
3 # Purpose:       Update the grml wallpaper
4 # Authors:       grml-team (grml.org)
5 # Bug-Reports:   see http://grml.org/bugs/
6 # License:       This file is licensed under the GPL v2 or any later version.
7 ################################################################################
8
9 . "$GRML_LIVE_CONFIG"
10
11 FONTFILE=${FONTFILE:-/usr/share/grml-live/fonts/graphicoreBitmapFont0-Light.otf}
12 TITLE_FONTSIZE=${TITLE_FONTSIZE:-200}
13 GRML_BG=${GRML_BG:-$target/usr/share/grml/desktop-bg.png}
14 GRML_WALLPAPER=${GRML_WALLPAPER:-$target/usr/share/grml/desktop.jpg}
15
16 echo "Creating release wallpaper"
17
18 if [ ! -x "$(which convert)" ]; then
19     echo "convert not installed, skipping release wallpaper."
20     exit 0
21 fi
22
23 if [ ! -f "$GRML_BG" ]; then
24     echo "Could not find Grml background image, skipping release wallpaper"
25     exit 0
26 fi
27
28 if [ ! -f "$FONTFILE" ]; then
29     echo "Could not find font $FONTFILE, skipping release wallpaper"
30     exit 0
31 fi
32
33
34 convert "$GRML_BG" -gravity center \
35     -fill white -font "$FONTFILE" \
36     -pointsize $TITLE_FONTSIZE \
37     -draw "text 0,0 \"$VERSION\"" "$GRML_WALLPAPER"
38