Cyberithub

How to Change GRUB Menu Font Color in Ubuntu 20.04 LTS

Advertisements

In this article, I will take you through the steps to change GRUB Menu Font Color in Ubuntu 20.04 LTS. If you are working on a Ubuntu based system from long time, then you must have noticed the color of the GRUB menu after every System reboot. If you got bored seeing the same color every time then you might think to change this color to some other attractive colors. Also, there might be a scenario where you had to add/change the background of GRUB Menu and now because of that font is not clearly visible. So with all these scenarios, it is always recommended to change the menu color by following some simple steps shown in below section.

GRUB Menu Colors

There are basically three color setting available to be changed:-

Advertisements
  • menu_color_highlight: It changes the color of the highlighted menu entry and its background within the menu
  • menu_color_normal: It changes the color of non-selected menu entry and its background within the menu
  • color_normal: It changes the color of text and background outside the menu

 

Color Setting Syntax 

Below are the syntax of different color settings. You can find complete list of colors in the GNU Manual.

  • menu_color_highlight=text-color/bg-color
  • menu_color_normal=text-color/bg-color
  • color_normal=text-color/bg-color

 

How to Change GRUB Menu Font Color in Ubuntu 20.04 LTS

How to Change GRUB Menu Font Color in Ubuntu 20.04 LTS

Also Read: How to Perform base64 Encoding and Decoding Using Linux Command Line

Advertisements

Step 1: Prerequisites

a) You should have a running Ubuntu 20.04 LTS Server.

b) You should have root access to run privileged commands.

Advertisements

c) You should have update-grub utility available in the System.

 

Step 2: Go to GRUB Menu

To go to GRUB Menu, you need to restart the System with init 6 or reboot command. Then immediately after splash screen you need to press Shift and hold on till you see the below GRUB Menu. Once the Menu is opened, press 'c' to open the GRUB Command line.

Advertisements

How to Change GRUB Menu Font Color in Ubuntu 20.04 LTS 2

 

Step 3: Change Font Color

Once GRUB Command Line is opened, you should see screen like below. Here you can provide the command to change the Menu Color. For example, we are currently changing menu_color_highlight to cyan/blue and menu_color_normal to yellow/black using below command.

How to Change GRUB Menu Font Color in Ubuntu 20.04 LTS 3

 

Step 4: Verify GRUB Menu

Once done Press Esc button to go back to GRUB Menu and verify if the menu color is indeed changed. If it goes well, then you should see screen like below. This confirms that the color you set is working fine. This however has one drawback. The change that you just did is the temporary one and hence it will get reset post System restart.

How to Change GRUB Menu Font Color in Ubuntu 20.04 LTS 4

 

Step 5: Perform Changes Permanently

So to make the above change permanent, you need to create a script called 05_menu_colors under /etc/grub.d/ directory using nano /etc/grub.d/05_menu_colors command and then paste all the below contents.

root@localhost:~# nano /etc/grub.d/05_menu_colors
#!/bin/sh

if [ "x${GRUB_BACKGROUND}" != "x" ] ; then
   if [ "x${GRUB_COLOR_NORMAL}" != "x" ] ; then
     echo "set color_normal=${GRUB_COLOR_NORMAL}"
   fi

   if [ "x${GRUB_COLOR_HIGHLIGHT}" != "x" ] ; then
     echo "set color_highlight=${GRUB_COLOR_HIGHLIGHT}"
   fi
fi

Make this file executable by using chmod +x /etc/grub.d/05_menu_colors command.

root@localhost:~#  chmod +x /etc/grub.d/05_menu_colors

Then open /etc/default/grub file using nano /etc/default/grub command and add below color information at the end of this file.

export GRUB_COLOR_NORMAL="yellow/black"
export GRUB_COLOR_HIGHLIGHT="cyan/blue"

 

Step 6: Rebuild GRUB Configuration

Then rebuild the latest GRUB Configuration by running update-grub command. This will automatically combines the settings from the /etc/default/grub file, /etc/default/grub.d/init-select.cfg file and others one, creating a /boot/grub/grub.cfg file which will be read during the boot process.

root@localhost:~#  update-grub
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found background: /root/71px-Ubuntu_and_Ubuntu_Server_Icon.png
Found background image: /root/71px-Ubuntu_and_Ubuntu_Server_Icon.png
Found linux image: /boot/vmlinuz-5.11.0-40-generic
Found initrd image: /boot/initrd.img-5.11.0-40-generic
Found linux image: /boot/vmlinuz-5.8.0-41-generic
Found initrd image: /boot/initrd.img-5.8.0-41-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done

 

Step 7: Test Your Configuration

Finally reboot the Server using same init 6 or reboot command to test and verify the configuration. You might notice that now the change in menu color persists and is not going back to the default one after every System reboot.

Leave a Comment