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