3 # bootanim - boot animation wrapper script for fbmngplay
5 # This program parses /etc/bootsplash/[THEME]/config/bootsplash-XxY.cfg
6 # to determine the correct animation position.
8 # This program is free software; you may redistribute it under the terms
9 # of the GNU General Public License. This program has absolutely no warranty.
11 # (C) 2002,2003 SuSE Linux AG. Written by Stefan Reinauer <stepan@suse.de>
13 # See http://www.bootsplash.org/ for more information.
18 echo "usage: $0 [start|stop|kill|next] -m [-r XxY] [-d dir] mng1 [mng2..]"
22 start starts given animation
23 stop fades out all running animations
24 kill immediately stops all animations
25 next continue to next animation.
27 Options for use with start command:
28 -r XxY screen resolution to use if unable to autodetect.
29 -d dir directory containing the animation files
30 -m play multiple animations
31 mng1|mng2 animation filename(s). Specify -m if multiple.
37 if [ "$UID" -ne "0" ]; then
38 echo "$0 must be started as user root!!!"
43 THEME="No theme selected"
44 [ -f /etc/sysconfig/bootsplash ] && . /etc/sysconfig/bootsplash
46 if [ ! -d /etc/bootsplash/themes/$THEME ]
48 echo "$0: could not find theme $THEME in /etc/bootsplash/themes."
52 MODE=$(/bin/fbresolution 2>/dev/null)
53 DIRECTORY=/etc/bootsplash/themes/$THEME/animations
60 # We fall through here.
64 /bin/killall -q -2 fbmngplay
69 /bin/killall -q fbmngplay
74 /bin/killall -q -USR1 fbmngplay
79 echo " Error: illegal parameter.";
86 # We end up in bootanim start
87 while getopts mr:d: name "$@"; do
92 if [ ! -d "$OPTARG" ]; then
93 echo "Not a valid directory."
106 OPTIONS="$OPTIONS -s"
110 echo "Internal Error."
116 function box() { true; } # ignore box descriptions in the config file
118 # Sourcing config file
119 if [ -f /etc/bootsplash/themes/$THEME/config/bootsplash-$MODE.cfg ]; then
120 . /etc/bootsplash/themes/$THEME/config/bootsplash-$MODE.cfg
122 echo "$0: No config file found for theme $THEME ($MODE)."
126 # echo "Dir: $DIRECTORY"
129 # echo "Pos: $ax,$ay"
130 # echo "options: $OPTIONS"
132 CMDLINE="/bin/fbmngplay -x $ax -y $ay $OPTIONS"
134 CMDLINE="$CMDLINE $DIRECTORY/$i"