Skip to content

Customizing

Willian Santos edited this page Apr 28, 2025 · 6 revisions

Let's start changing some values in /etc/default/grub:

  1. Change Grub's resolution:
# Example: GRUB_GFXMODE=1920x1080
GRUB_GFXMODE=<your_screen_resolution>
  1. Remember last entry selected on boot:
GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true

Fonts

Grub uses its own font format called PFF2. You can convert a .ttf font file to .pf2 using grub-mkfont:

# Example: grub-mkfont -o "Ubuntu Bold 20.pf2" --size=20 Ubuntu-Bold.ttf
$ grub-mkfont -o <output> --size=20 <input>

Note that the name convention is important. If you face difficulties loading the font later, refer to this link.

Icons

Grub assign icons to the entries by looking at their classes in /boot/grub/grub.cfg and searching .png files with the same name inside the icons/ directory. Here's an example:

...will load /boot/grub/themes/lain/icons/arch.png. If you plan to replace these icons, use an 64x64 image. You can resize an image using ImageMagick with the following command:

$ mogrify -resize 64x64 image.png

Change icons color

You can change the color for all the icons in lain/icons/ with ImageMagick using the following command:

$ cd lain/icons/
# Example: make everything red: mogrify -fill '#FF0000' -colorize 100% *.png
$ mogrify -fill '<new_color>' -colorize 100% *.png

Further customization

This theme includes a .fig file in lain/assets/. You can use Figma to import this file.

Note that every part of the theme in lain/theme.txt has a name matching its representation in the Figma file. The same is true for positions and sizes. You can move things around in Figma, copy their positions/sizes and paste in lain/theme.txt, and it will be displayed in Grub exactly the same.

You can also change the frame's size to match your screen's resolution. Just select in the layers tree and tweak the "Dimensions" property on the right.

Clone this wiki locally