Skip to documentation content

GRUB 2 Components Reference

Complete guide to every visual gfxmenu component: boot_menu, label, progress_bar, circular_progress, image, and special __timeout__ IDs.

Overview of visual components

Beyond layout containers (hbox, vbox, and canvas), GNU GRUB 2 provides five visual components (on-screen elements that do not hold child widgets). Grub Designer renders each one faithfully to GRUB's C engine.

boot_menu

Displays the list of operating systems and boot entries generated in grub.cfg. Every practical theme must include one boot_menu.

boot_menu.theme.txt
        
          
            + boot_menu {
          
              left = 50%-280
          
              top = 50%-180
          
              width = 560
          
              height = 360
          
              item_font = "Inter Regular 20"
          
              selected_item_font = "Inter Bold 20"
          
              item_color = "#94A3B8"
          
              selected_item_color = "#FFFFFF"
          
              item_height = 42
          
              item_padding = 10
          
              item_spacing = 8
          
              icon_width = 28
          
              icon_height = 28
          
              item_icon_space = 12
          
              menu_pixmap_style = "menu_*.png"
          
              selected_item_pixmap_style = "select_*.png"
          
              scrollbar = true
          
              scrollbar_width = 10
          
              scrollbar_thumb = "thumb_*.png"
          
            }
          
        
      
  • icon_width / icon_height: Icons are loaded from icons/<class>.png matching each menuentry --class in grub.cfg.
  • item_padding vs. item_spacing: item_padding adds horizontal inset inside the list, while item_spacing sets the vertical gap between consecutive entries.

label

Renders single-line bitmap text (gui_label.c). Its dimensions are computed automatically from its text and .pf2 font.

Built-in text macros

GRUB 2 automatically expands special macros inside text:

Macro Expanded content
@KEYMAP_SHORT@ Short localized hint (enter: boot, e: options, c: cmd-line)
@KEYMAP_LONG@ Longer localized keyboard instruction line
@KEYMAP_SCROLL_ENTRY@ Horizontal scroll hint for long entry names
@TIMEOUT_NOTIFICATION_SHORT@ Short countdown notice (when id = "__timeout__")
@TIMEOUT_NOTIFICATION_MIDDLE@ Medium countdown notice
@TIMEOUT_NOTIFICATION_LONG@ Full localized countdown sentence
label.theme.txt
        
          
            + label {
          
              id = "__timeout__"
          
              left = 50%-200
          
              top = 100%-64
          
              width = 400
          
              align = "center"
          
              font = "Inter Regular 16"
          
              color = "#9BB4FF"
          
              text = "Booting automatically in %d seconds"
          
            }
          
        
      

progress_bar

Draws a horizontal progress indicator — most commonly bound to id = "__timeout__" so users visually see the remaining seconds before the default OS boots.

  • Solid color mode: Configure fg_color, bg_color, and border_color.
  • Pixmap 9-slice mode: Assign bar_style = "bar_*.png" and highlight_style = "fill_*.png" for rounded or glowing bars.
  • Optional text overlay: Set show_text = true and text = "@TIMEOUT_NOTIFICATION_SHORT@" (or "%d s").
Visual reference preview only
65%
Booting in 4s
theme.txt propertybar_style = "bar_*.png"
Visual role in GRUB 2Outer track & background 9-slice box

Defines the static container track rendered across the full width of the progress_bar. Its 9-slice borders act as inner padding around the active fill.

Interactive anatomy of progress_bar layers: bar_style, highlight_style, and text overlay (preview for visual reference only).

circular_progress

Draws a radial ring of tick sprites around a center bitmap (gui_circular_progress.c), ideal for minimal HUD boot screens:

Visual reference preview only
65%
16
theme.txt propertycenter_bitmap = "ring_center.png"
Visual role in GRUB 2Static centered bitmap (1 image)

An 8-bit RGBA PNG drawn once right in the middle of the widget — ideal for an OS emblem, dial backdrop, or subtle ring base.

Interactive anatomy of circular_progress layers: center_bitmap, tick_bitmap, and start_angle (preview for visual reference only).
circular_progress.theme.txt
        
          
            + circular_progress {
          
              id = "__timeout__"
          
              left = 50%-48
          
              top = 74%
          
              width = 96
          
              height = 96
          
              center_bitmap = "ring_center.png"
          
              tick_bitmap = "ring_tick.png"
          
              num_ticks = 24
          
              ticks_disappear = false
          
              start_angle = -64
          
            }
          
        
      
  • start_angle uses GRUB's 1/256 circle units (-64 equals 12 o'clock / top center).
  • Both center_bitmap and tick_bitmap must be 8-bit RGBA PNGs.

image

Displays a static bitmap (gui_image.c) scaled to fill its explicit width and height (object-fill). Ideal for distribution emblems, accent dividers, or decorative HUD badges.