What's that ?
If you have installed any GNU/Linux distro (except some, like Pop!_OS), you might have noticed something when your PC boots that looks like some variant of this image
This is the GRUB (GRand Unified Bootloader), an Open Source bootloader that allows users to boot into many types of operating systems including Windows.
Now what the heck is a bootloader ?
When your computer boots, the first thing that loads is the UEFI (Unified Extensible Firmware Interface) or BIOS (Basic Input/Output System) depending on the age of your computer. These are programs stored inside special memory blocks of the motherboard having no direct relation with any Operating System or Hard Drive, and allow you to control your hardware, check specs, manage bootloader order etc. UEFI/BIOS then execute your first priority Bootloader. Now bootloader is a special program that allows the user to boot into their operating system. It contains information about location of your boot files, kernel etc.
Windows has its own bootloader too. If you ever tried dual booting multiple versions of Windows, you might have noticed that upon startup, it asks which version of Windows you want to boot into. But Windows bootloader only supports booting into versions of Windows, and it won't help you booting another operating system like GNU/Linux.
So in order to boot into our favorite Linux distro and have dual booted Windows at the same time, we need a general purpose bootloader that supports all of these operating system, and thus GRUB comes to the rescue.
Okay, gotcha. Customization ?
GRUB supports themes out of the box. You just have to
- Download any GRUB theme you like. You can find many good ones here.
- Extract the downloaded theme.
- Copy the extracted folder to
/boot/grub/themes
- Make a copy of GRUB's current config. Run
sudo cp /boot/grub/grub.cfg ~/grub.cfg && sudo cp /etc/default/grub ~/grub
- Open
/etc/default/grub
asroot
- Change
GRUB_THEME
to/boot/grub/themes/{the theme folder you just copied}/theme.txt
. Save and exit. - Run
update-grub
ORgrub-mkconfig -o /boot/grub/grub.cfg
asroot
. This will read/etc/default/grub
and generate/boot/grub/grub.cfg
, the GRUB's config file. - Reboot and you will see a new screen upon boot.
This Theme: Distro GRUB Themes
Hmmm. But That's tedious ๐ฅฑ
Bored of copy pasting files manually ? Scared of changing important files by hand ? GRUB Customizer comes to the rescure. It is a GUI program that takes away all the pain of manually changing files.
Installation
You can find grub-customizer package in your distro's package repository.
In Debian based distros (Ubuntu, Pop!_OS etc), if you can't find grub-customizer package, you might need to add external PPA.
sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt-get update
sudo apt-get install grub-customizer
This will install latest grub-customizer.
Usage
Open grub-customizer as root. sudo grub-customizer
Save
is equivalent of manually runningsudo grub-update
Remove
removes a menu entry (the options that show OSs' name) from GRUB- Similarly other buttons do obvious tasks like moving menu entry, editing menu entry etc.
Installing Themes
- Go to
Appearance Settings
- Click on the
โ button
- Navigate to the theme file you downloaded and open it
- Finally, click save. It will update the GRUB config.
You can always change background, config etc manually, but recommended way is to use pre-tested themes via grub-customizer to make yourself stay in the safe zone.
Anything Else ?
There are many, actually. You can manually change screen resolution, background, fonts, menu entries etc. Discussing every feature is beyond the scope of this article, but I'd like to have a glace at two cool ones.
Feeling Hacky ?
Do you want your system to print out a bunch of log messages when it boots so that you feel like The Anonymous ? Say no more.
- Go to
General Settings
ingrub-customizer
- In the
Kernel Parameters
input box, clear outquite splash
- Save.
Next time you open your system, you'll be greeted with log messages instead of the boring boot animation. ๐
I'm a Typographer ๐ซ
Yeah, you can create custom fonts for GRUB too.
- Download any font you like in TTF format.
- Run
sudo grub-mkfont -s {size of font you want eg: 16} {path of output file}.pf2 {path of input font}
. Eg -sudo grub-mkfont -s 16 CascadiaMonoPL.pf2 CascadiaMonoPL.ttf
assuming CascadiaMonoPL is in the same directory. This will generate the bitmap font file CascadiaMonoPL.pf2 - Copy the generated font to your current GRUB theme folder.
sudo cp {output font}.pf2 /boot/grub/themes/{name of current theme}
- Open
/boot/grub/themes/{name of current theme}/theme.txt
asroot
and change all occurrences of Font to {output font}.pf2 sudo update-grub
This will change all the text to your given font.
Troubleshooting
- Just in case things don't go as expected, you can always copy
grub.cfg
andgrub
file to/boot/grub/grub.cfg
and/etc/default/grub
respectively and you'll be back to your previous config. - If you get
/etc/default/grub
not found or any error like that (most probably you're on Pop!_OS), this means your system doesn't have GRUB installed. You will need to manually install it and then start customizing.
My Current Setup
(open in new tab for better view)
- Theme: DedSec Wrench
- Fonts: Custom (CascadiaMonoPL)
At last....
Feel free to explore all the customization that GRUB offers. And if you want to test the themes on the go, there is a tool even for that. grub2-theme-preview uses virtual machine to emulate a boot and shows the preview of the theme you provide.
Thanks for reading ๐ซก.