This is the main boot menu theme and layouts. It is quite complex so we will go through steps by steps.
For the first elements, we will set the general properties first. This allows us to carefully calculate the overall layouts and dimensions. These can be easily defined:
left
top
For width and height, you should carefully measure your design and will be discussed internally inside the correct sub-topic. Keep in mind that scroll bar is available for very long boot menu.
These are the item, and its highlighted properties for the menu. Based on the image above, dummy entry 4 is the highlighted one. You can configure each of them to appear differently.
item_color
, selected_item_color
- accept color values.
item_font
, selected_item_font
- alters item text fonts. Usually for consistency, these 2 remains unset.
Decoration drawn outside the item, selected or otherwise. They both accepts filename with space-box allocations. Example:
selected_item_pixmap_style = "button_*.png"
Similar to item_pixmap_style
. Only difference is that this affects the menu instead.
For vertical height and spacing, they are measured in a way shown in the following diagram:
All 4 of them accepts integer values:
item_padding = 20
item_spacing = 20
item_height = 30
height = 289
Each item has an accompanying icon image. By default, they are:
icon_width = 32
icon_height = 32
item_icon_space = 4
The width arrangement is illustrated as follows:
The text is always indented, be it displaying icon or otherwise. To remove the indention, set:
icon_width = 0
item_icon_space = desired spacing from left border
On the right, it is always shorten by 2 pixels (hence, item_padding + 2
)
All icons has a specific filename, stored under /boot/grub/themes/<your_theme>/icons
.
Via class name. The class name must have the exact match to the filename. Example: myfile ➔ myfile.png
. There are some predefined classes, arranged in priority:
windows
> os
gnu-linux
> gnu
> os
osx
> darwin
> os
hurd
> gnu
> os
All icon files should be in PNG format, with file extension: .png
.
These are for creating a scrollbar next to a long menu.
scrollbar
- instructs GRUB to render the scrollbar when scrollbar_frame
and scrollbar_thumb
are available.scrollbar_frame
- image pattern for the entire scrollbar.scrollbar_thumb
- image pattern for the moving part of the scrollbar.scrollbar_width
- width of the scrollbar.scrollbar_slice
- direction for positioning the scrollbar.scrollbar_left_pad
- left scrollbar padding in pixels. Unused if “scrollbar_slice“ is “west“.scrollbar_right_pad
- right scrollbar padding in pixels. Unused if “scrollbar_slice“ is “east“.scrollbar_top_pad
- top scrollbar padding in pixels.scrollbar_bottom_pad
- bottom scrollbar padding in pixels.scrollbar
- accept "True"
or "False"
. Default is "True"
. scrollbar_frame
- accepts all direction image file string, e.g: scrollbar_*.png
scrollbar_thumb
- accepts all direction image file string, e.g: scrollbar_*.png
scrollbar_width
- numbers. e.g. 10
scrollbar_slice
- "west"
, "center"
, "east"
(default). "west"
scrollbar_left_pad
- numbers. e.g. 10
scrollbar_right_pad
- numbers. e.g. 10
scrollbar_top_pad
- numbers. e.g. 10
scrollbar_bottom_pad
- numbers. e.g. 10
scrollbar_thumb
.scrollbar_frame
.scrollbar_frame
and scrollbar_thumb
. Otherwise, you won't see any scrollbar.scrollbar_frame
and scrollbar_thumb
.scrollbar_width
is referring to the central part of scrollbar_frame
.item_padding
does not affect scrollbar.+ boot_menu {
left = 50%-300
top = 50%-100
width = 600
height = 289
selected_item_color = "#0000FF"
selected_item_pixmap_style = "button_*.png"
menu_pixmap_style = "menu_*.png"
item_padding = 20
item_height = 30
item_spacing = 20
scrollbar_thumb = "scrollbar_thumb_*.png"
scrollbar_frame = "scrollbar_frame_*.png"
scrollbar_width = 10
}
That's all about scrollbar.