]> git.ipfire.org Git - people/amarx/ipfire-3.x.git/blame - pkgs/grub/05_theme
Change file layout of the makefiles.
[people/amarx/ipfire-3.x.git] / pkgs / grub / 05_theme
CommitLineData
bd2bcd39
SS
1#!/bin/bash -e
2
3source /usr/lib/grub/grub-mkconfig_lib
4
5set_mono_theme()
6{
7cat << EOF
8set menu_color_normal=white/black
9set menu_color_highlight=black/white
10EOF
11}
12
13# check for usable backgrounds
14use_bg=false
15if [ "$GRUB_TERMINAL_OUTPUT" = "gfxterm" ] ; then
16for i in {/boot/grub,/usr/share/images/desktop-base}/splash.{png,tga} ; do
17if is_path_readable_by_grub $i ; then
18bg=$i
19case ${bg} in
20*.png) reader=png ;;
21*.tga) reader=tga ;;
22*.jpg|*.jpeg) reader=jpeg ;;
23esac
24if test -e /boot/grub/${reader}.mod ; then
25echo "Found background: `basename ${bg}`" >&2
26use_bg=true
27break
28fi
29fi
30done
31fi
32
33# set the background if possible
34if ${use_bg} ; then
35prepare_grub_to_access_device `${grub_probe} --target=device ${bg}`
36cat << EOF
37insmod ${reader}
38if background_image `make_system_path_relative_to_its_root ${bg}` ;
39then
40set color_normal=black/black
41set color_highlight=magenta/black
42else
43EOF
44fi
45
46# otherwise, set a monochromatic theme for IPFire
47if ${use_bg} ; then
48set_mono_theme | sed -e "s/^/ /g"
49echo "fi"
50else
51set_mono_theme
52fi