Modify the background image, font size, and color of Ubuntu11.10's Grub2

Source: Internet
Author: User
It seems that the method for modifying the background image of each Ubuntu version is different. The syntax of 05_debian_theme is often changed. The method set in Ubuntu10.04 is not easy to use in 11.10. ~~~ After studying for a long time, I finally figured out how to set it. I modified the background image and font color code: sudogedit/etc/grub. d/05_debian_theme find the code: if [-f "/usr/share/desktop-base/gr it seems that the method for modifying the background image in each Ubuntu version is different;
The syntax of 05_debian_theme is frequently changed;
Ubuntu 10.04 is not easy to use in 11.10.
~~~
After studying for a long time, I finally figured out how to set it;

Modify the background image and font color
Code:Sudo gedit/etc/grub. d/05_debian_theme
Find
Code:If [-f "/usr/share/desktop-base/grub_background.sh"]; then
. "/Usr/share/desktop-base/grub_background.sh"
Add
Code:Else
WALLPAPER = "/usr/share/images/desktop-base/desktop-grub.png"
COLOR_NORMAL = "green/black"
COLOR_HIGHLIGHT = "magenta/black"


The path of the background image is placed behind WALLPAPER, and the image to be set as the background can be placed in the corresponding path. jpg, jpeg, png, and tga formats are supported;
(The image resolution must be consistent with the screen resolution.)
COLOR_NORMAL is the color of the unselected menu options, the first color is the text color, and the second is the background color (if the background image has been set, it is better to set the background color to black );
COLOR_HIGHLIGHT sets the selected color. The first color is the high-brightness text color, and the second is the background color of the selected row. If/black is the second option, the high brightness will be transparent, and only the text color will change;

Tips: when used as the second color,/black is the default transparent color of GRUB 2. If you use a boot screen, you only need to change the first color (for example, xxxxx/black ). If the second color is changed to a color other than black
Color, the guiding screen will be hidden behind the solid background.

Color reference:

(When the GRUB 2 boot screen/menu appears, press any key to stop the countdown;
Press c to enter the GRUB 2 command line;
Set color_normal = first-color/black or set color_highlight = first-color/second-color
The text color is displayed immediately after the command is entered. You can use the up key to call the last executed command and then edit it to quickly test different color combinations.
Once you want to finish, Press ESC to return to the menu.
Repeat the preceding steps.
Write down the desired color combination, start it normally, edit/etc/grub. d/05_debian_theme, and save the modification permanently .)

Modify font size
Find a font file that supports Chinese characters, such as a wqy-microhei.ttc (ttf or ttc can be );
(Font file wqy-microhei.ttc in the following directory/usr/share/fonts/truetype/wqy)
Run the following command to create a font file:

Code:Grub-mkfont-s 12-o unicode. pf2 wqy-microhei.ttc

Replace the newly generated unicode. pf2 file with the unicode. pf2 file in the/usr/share/grub directory;
Remember to back up the original unicode. pf2 file first, and then restart it to check the effect. If it is not good enough, re-generate unicode. pf2 in a new font;
Remember to select the font files supported by Chinese characters to generate them. Otherwise, only the box is displayed in Chinese.
The font size is not big enough. Modify the-s 12 parameter. The larger the number, the larger the font size.

Finally, don't forget

Code:Sudo update-grub

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.