Skip to documentation content

Introduction to GRUB 2 Themes

How GNU GRUB 2 gfxmenu themes work, what goes inside a theme directory, and how Grub Designer maps visually to theme.txt.

What is a GRUB 2 gfxmenu theme?

GNU GRUB 2 renders graphical boot menus through its gfxmenu module. Rather than using HTML or CSS, GRUB reads a single declarative manifest called theme.txt alongside local raster images and pre-rendered bitmap fonts (.pf2).

Every visual element you place inside Grub Designer maps 1:1 to a real gfxmenu component compiled into theme.txt — no proprietary runtime, no extra boot modules, and no guesswork.

Standard theme folder structure

A self-contained GRUB 2 theme directory is easy to inspect and share. Keep all paths inside theme.txt relative to the theme root:

my-theme/
        
          
            my-theme/
          
            ├── theme.txt               # Main declarative layout & global settings
          
            ├── background.png          # 8-bit RGB/RGBA wallpaper
          
            ├── inter_regular_20.pf2    # Pre-rendered PF2 bitmap font
          
            ├── inter_bold_24.pf2
          
            ├── menu_nw.png ... menu_se.png   # 9-slice pixmap box for boot_menu
          
            ├── select_w.png ... select_e.png # Highlight bar slices
          
            └── icons/
          
                ├── ubuntu.png          # OS icons matched by GRUB menuentry --class
          
                ├── arch.png
          
                ├── debian.png
          
                └── windows.png
          
        
      

Anatomy of theme.txt

A theme.txt file has two parts: global properties at the top (key: value) and a tree of component blocks (+ component_type { ... }):

theme.txt
        
          
            # Global theme properties
          
            title-text: ""
          
            desktop-image: "background.png"
          
            desktop-color: "#090B10"
          
            terminal-font: "JetBrains Mono Regular 16"
          
            
          
            # Main boot menu component
          
            + boot_menu {
          
              left = 50%-280
          
              top = 50%-180
          
              width = 560
          
              height = 360
          
              item_font = "Inter Regular 20"
          
              item_color = "#CBD5E1"
          
              selected_item_color = "#FFFFFF"
          
              item_height = 42
          
              item_padding = 12
          
              item_spacing = 8
          
              icon_width = 28
          
              icon_height = 28
          
              item_icon_space = 12
          
            }