正确修改Ubuntu12.04的grub2启动背景图片和菜单颜色的方法,这次是真的!
发表于 : 2012-06-14 19:23
正确修改Ubuntu12.04的grub2启动背景图片和菜单颜色的方法,这次是真的!
这个命题最近很火啊,本板块几乎一半帖子都是关于这个的,以前的方法,新研究的方法出了很多啊,可是很多都不行。
实在是受不了了,于是刚刚自己研究了一下/etc/grub.d/05_debian_theme,成功修改,不用再安装任何附加组件,只要修改/etc/grub.d/05_debian_theme就可以。
具体如下:
1.菜单的颜色根据个人喜好来改啊,支持这些:

2.顺便给出改图片分辨率,启动默认项等:
修改/etc/default/grub
效果:
这个命题最近很火啊,本板块几乎一半帖子都是关于这个的,以前的方法,新研究的方法出了很多啊,可是很多都不行。


具体如下:
说明:1.复制图片文件到/boot/grub/,文件名是啥无所谓,只要格式是*.jpg *.JPG *.jpeg *.JPEG *.png *.PNG *.tga *.TGA都行,都能自动找到,如果有多个,那么显示第一个找到的图片。
2.修改/etc/grub.d/05_debian_theme
把改为:代码: 全选
# Next search for pictures the user put into /boot/grub/ and use the first one. for background in *.jpg *.JPG *.jpeg *.JPEG *.png *.PNG *.tga *.TGA; do if set_background_image "${background}"; then exit 0 fi done
此处命令格式为:set_background_image "${WALLPAPER}" "${COLOR_NORMAL}" "${COLOR_HIGHLIGHT}"代码: 全选
# Next search for pictures the user put into /boot/grub/ and use the first one. for background in *.jpg *.JPG *.jpeg *.JPEG *.png *.PNG *.tga *.TGA; do if set_background_image "${background}" "white/black" "light-red/blue"; then exit 0 fi done
3.更新grub代码: 全选
sudo update-grub
1.菜单的颜色根据个人喜好来改啊,支持这些:

2.顺便给出改图片分辨率,启动默认项等:
修改/etc/default/grub
代码: 全选
GRUB_DEFAULT="Windows 7 (loader) (on /dev/sda1)"
GRUB_TIMEOUT=5
GRUB_GFXMODE=800x600
GRUB_DISABLE_LINUX_RECOVERY="true"
代码: 全选
~$ sudo update-grub
Generating grub.cfg ...
Found background image: lc_wallpaper.png
Found linux image: /boot/vmlinuz-3.2.0-25-generic-pae
Found initrd image: /boot/initrd.img-3.2.0-25-generic-pae
Found linux image: /boot/vmlinuz-3.2.0-24-generic-pae
Found initrd image: /boot/initrd.img-3.2.0-24-generic-pae
Found linux image: /boot/vmlinuz-3.2.0-23-generic-pae
Found initrd image: /boot/initrd.img-3.2.0-23-generic-pae
Found Windows 7 (loader) on /dev/sda1
Found Mac OS X on /dev/sda2
done