Translate

2014년 7월 3일 목요일

[링크] Grub2 배경과 글자 색 바꾸기 ...

원문 : Changing Grub2 Display
https://help.ubuntu.com/community/Grub2/Displays


...
 

Image Priority


If more than one suitable image is available to GRUB 2, the following order is used to determine which image is used as the GRUB 2 background.
  1. GRUB_BACKGROUND setting in /etc/default/grub
  2. First image found in /boot/grub
    • The first image found, in this order: jpg, JPG, jpeg, JPEG, png, PNG, tga, TGA
    • If multiple images of the same extension, alphanumerically.
  3. Wallpaper designated in /usr/share/desktop-base/grub_backgorund.sh (if desktop-base installed)
  4. WALLPAPER= line in /etc/05_debian_theme * GRUB 1.98 only
    • The default setting is /usr/share/images/desktop-base/desktop-grub.png (the desktop-base package must be installed)
  5. Default theme (no image): default_theme colors specified in /etc/grub.d/05_debian_theme
Note: Not all these options are available in GRUB 1.98

GRUB 1.99 and later


The following guidance for setting the background image is for GRUB 2 version found in Ubuntu 11.04, Natty Narwhal and later.
GRUB 1.99 greatly simplified adding a GRUB 2 splash image. In addition to the following procedures, the methods detailed for GRUB 1.98 will also work.
Note: Adding a background image requires system folder operations. The user must use administrator privileges to make the required changes.
  1. Review image requirements in the previous section to ensure the image you select is compatible with GRUB 2.
The user has two options for selecting the splash image to be used. The first requires editing a GRUB 2 configuration file. The second is to copy a compatible image file to the grub folder.
  1. Open /etc/default/grub with a text editor.
    • Add the following line:
      • GRUB_BACKGROUND=/path/filename
      • Example: GRUB_BACKGROUND="~/Pictures/grubbackround.png"
    • This option takes precedence over the next method.
OR:
  1. Place a suitable image in the grub folder.
    • The default location for this folder is /boot/grub.
    • If more than one suitable image resides in the grub folder, the priority for the image used in GRUB 2 is:
      • First image found in /boot/grub
        • The first image found, in this order: jpg, JPG, jpeg, JPEG, png, PNG, tga, TGA
        • If multiple images of the same extension, alphanumerically.
  2. Update GRUB to incorporate the image into the GRUB 2 menu:
    • sudo update-grub
   

...

Setting Menu Font Colors


Setting menu font colors is normally the job of theme files, which are discussed in greater depth in the Grub2/Themes community document. This section will detail how to change font, highlight and background colors on the GRUB 2 menu without creating detailed themes.

GRUB 2 Colors


For each font color entry, two inputs are required, separated by a /. The first entry is the text color, while the second entry is generally the background color if an image is not present.
  • Example: menu_color_highlight=black/white
GRUB 2 accepts the following colors for the menu fonts and background:

  • black
    blue
    brown
    cyan
    dark-gray
    green
    light-cyan
    light-blue

    light-green
    light-gray
    light-magenta
    light-red
    magenta
    red
    white
    yellow

About "Black"


GRUB 2 treats "black" differently when it is the second entry in a setting, for example " color_normal=white/black ". In this case, black is considered a value for "transparent". The underlying image will be visible rather than the color black. This distinction becomes important when an image is present in the menu. GRUB 2 automatically ignores the menu_color_highlight and menu_color_normal values when an image is present and uses color_normal=white/black and color_highlight=black/white.
Setting the background value of non-highlighted entries black (the "transparency" value) ensures the image will be viewable. Since the developers don't know what image the user might choose, they selected the other values to provide the best chance that the menuentries will be visible. The colors may be changed to other values when using themes or by writing them directly into the 05_debian_theme file.
important If using a splash image and the second value of color_normal is not black the splash image will be hidden behind a solid color background.

Configuration settings (no splash image)


The 3 main font color settings which the user might wish to change on the GRUB 2 menu are listed below. These include the color codings for the menuentries (highlighted and unselected) and the colors of the background and text outside of the menu 'box'.
  • menu_color_highlight=text-color/bg-color
    The color of the highlighted menuentry and its background within the menu 'box'.

    menu_color_normal=text-color/bg-color
    The color of non-selected menuentries within the menu 'box'

    color_normal=text-color/bg-color
    The color of the text and background outside the menu 'box'
Each setting contains two values, separated by a /. The first is the foreground color; the second is the background color. In the example below the colors of the text/background are produced by the settings in bold white.
g2_nosplash_menu














color_normal=cyan/black *

* Black in this case is treated as a transparency, revealing the Ubuntu 12.04 aubergine.

menu_color_highlight=yellow/dark-gray

menu_color_normal=black/light-gray

Although specific theme files should be built and referenced in /etc/default/grub, for Ubuntu users the /lib/plymouth/themes folder contains a relatively empty GRUB 2 theme file referenced during update-grub execution. A user can add basic settings with minimal effort to this file to change the GRUB 2 menu colors if no splash image is detected. Refer to the next section for an explanation of what happens if a splash image is detected. Since this is a system file, administrator/root privileges are required to edit the file.
To modify font colors when no splash image is used:
  • Open /lib/plymouth/themes/default.grub for editing as root.
    • Add the following entries below the existing lines. Substitute color values as desired:
      • set menu_color_highlight=yellow/dark-gray
      • set menu_color_normal=black/light-gray
      • set color_normal=yellow/black
  • Save the file and run update-grub The above example entry creates yellow highlighted text on a dark gray bar with black unselected text on a light gray background. Outside the 'box' is yellow informational text and an aubergine background. The aubergine background is the result of the Ubuntu 12.04 settings. Ubuntu has a default background of aubergine, and in this case the black setting in color_normal is treated as transparent.

Configuration settings (splash image present)


When an image is present GRUB 2 uses only color_normal and color_highlight settings. Themes are recommended when the user wishes to override the default monochromatic color text scheme. The user can add the menu_color_highlight and menu_color_normal settings to system files if desired.
  • The color of selected menu entries is set by menu_color_highlight setting.
  • The color of non-selected menu entries is set by menu_color_normal setting.
  • The second value of the color_normal entry must be set to black for the image to be visible.
To add menu_color_normal and/or menu_color_highlight values when using a splash image:
  • Open /etc/grub.d/05_debian_theme as root.
    • Find the following lines:
      • if [ -z "${2}" ] && [ -z "${3}" ]; then 
      •    echo "  true"
      • fi
    • Change the entry to the following, replacing 'color1' and 'color2' to the desired colors. Leave /black as is!
      • if [ -z "${2}" ] && [ -z "${3}" ]; then 
      •    # echo "  true" 
      •    echo "    set color_highlight=color1/color2" 
      •    echo "    set color_normal=color1/black"
      • fi
  • Save the file and run update-grub


.

댓글 없음:

댓글 쓰기