Adapt the appearance of the GRUB boot menu, boot screen, and KDE splash screen

Variations on a Theme

Article from Issue 233/2020
Author(s):

Power users can adjust the look of their desktops in openSUSE with just a few clicks. We'll show you how to customize the GRUB boot menu, the boot splash screen, and the KDE start screen.

The splash screen and other startup images are a familiar sight for any Linux distribution. Although the desktop background and color scheme can be quickly customized to suit your tastes, the GRUB boot menu (Figure 1) and the boot splash screen (Figure 2) are far more difficult to customize. This article describes how to modify and unify your system by changing the GRUB boot menu and the boot and KDE splash screens to fit your personal preferences. The following examples are based on openSUSE, but the procedures are similar for other Linux systems – especially KDE-based systems.

Figure 1: Even the first sign of life from openSUSE, the GRUB menu, is green.
Figure 2: OpenSUSE only offers a uniform green for the boot splash screen.

Start with YaST

If you're working in openSUSE or another SUSE variant, you can use YaST to select a different theme for the GRUB boot menu. Use the graphical tool in System/YaST Bootloader (Figure 3). Select the theme.txt file for your choice of theme. YaST will do the rest of the work.

Figure 3: In the center tab of the YaST Bootloader module, select the theme.txt configuration file of a GRUB theme installed on your system.

Unfortunately only the default theme is preinstalled on openSUSE. However, there is a grub2-theme-breeze package for a retrofit that matches the plain, monochrome, original KDE start screen. Pling.com [1], the former OpenDesktop.org, has a choice of around 350 themes. Unpack the zip archive you download from the site and – working with root privileges – move the subfolder with the theme.txt file into the /boot/grub2/themes/ directory.

Then start the YaST Bootloader module and open the Kernel Parameters tab. Click on Browse to the right of the input box for the Console theme, and navigate to the theme folder you copied to /boot/grub2/themes/ in the file browser. When you get there, select the theme.txt file and press OK in YaST. After rebooting the system, you can stand back and admire the new look of the boot menu (Figure 4).

Figure 4: A cosmetic color change for the boot menu does not require any in-depth knowledge of the GRUB configuration syntax.

Editing a Theme

Creating your own GRUB theme is somewhat complicated. It is easier to adapt an existing theme to suit your requirements. To create a background image and colors that you like, you need to be familiar with a few elements of the GRUB theme description language [2].

First copy the /boot/grub2/themes/openSUSE/ folder to your home directory for editing. Then open the theme.txt file in a text editor. The file consists of five parts : a definition of global properties at the beginning and the sections + **image {}, + boot_menu {}, progress_bar {} and + hbox {}. You define the openSUSE logo, the countdown time before auto-booting, the boot menu itself, and the bottom line with the keyboard shortcuts.

To adjust the colors of the GRUB menu, you need to change some statements in theme.txt and the PNG files in the themes folder. The hexadecimal value to the right of desktop-color: defines the background color. The KDE KColorChooser program returns the appropriate values with the help of the default KDE color picker. Figure 4 shows a GRUB menu, where the values for desktop-color in the global header, as well as fg_color, bg_color and border_color in the + progress_bar {} section, have been adjusted.

The colors of the bars that highlight a selected menu item are not based on a setting in theme.txt, but on bitmaps. This means that 3D effects can be realized, although the openSUSE theme does not use any. To adjust the color of the highlight bar, open the highlight_c.png file in Gimp (Figure 5). The slider_* files are responsible for displaying a scrollbar, which only appears if there is not enough space for all the items in the start menu.

In Gimp, click on the upper color box just below the tool palette (highlighted in Figure 5). In the HTML notation field of the Gimp color selector, enter hexadecimal values as in theme.txt. Use the Fill tool (also highlighted) to color the formerly green areas to reflect your wishes. The highlight_c.png file consists of only one pixel. Open in Gimp and zoom in until the scale is large enough.

Figure 5: In graphical mode, openSUSE's GRUB configuration uses bitmaps for the highlight bar. Gimp gives you an easy option for changing the color.

The important thing to know about 3D designs is that the highlight and slider settings result from the values for selected_item_pixmap_style (=highlight_*.png) and scrollbar_thumb (=slider_*.png).

The file names for the highlight_* and slider_* files include final characters defining the position on a map: _c, _w, _n, _s, _e, _ne, _nw, _se, and _sw. For instance, highlight_c.png refers to the center of the screen, and _w, _n, _s, and _e refer to the four cardinal directions.

A background image is far more appealing than a monochrome background. The image must be a PNG or JPEG image with a color depth of 8 bits that you copy into the theme folder. In theme.txt, add desktop-image: "file.png" at the start of the global block.

Working with administrative privileges, copy the theme folder to /boot/grub2/themes/ and select the customized theme.txt file in the YaST Bootloader module. Even if you create new versions where the path to theme.txt does not change, you still need to open the YaST module each time and update the GRUB configuration by pressing OK. All other aspects of GRUB themes are explained in the GRUB manual [2].

Boot Animation

After booting the system with the bootloader, the boot splash screen (Figure 2) appears; it remains visible for a few seconds during system startup. This splash screen is produced by Plymouth, a tool that starts early in the boot process and displays a graphical image. Numerous Plymouth themes are available on Pling.com [3]. You can change the splash screen with a simple command.

Unpack the downloaded archive in /usr/share/plymouth/themes/. If several subfolders exist there, you will recognize the actual theme folder by the fact that it contains a configuration file with the .plymouth extension. Then run the plymouth-set-default-theme -l command and look for the new theme. The plymouth-set-default-theme -R command then installs the theme.

You do not need to reboot the system to view the new theme. Install the plymouth-x11-renderer package, launch plymouthd as root, and then call plymouth --show-splash. The Plymouth screen is displayed in a window. Press the right arrow key to continue the animation. However, the window cannot be closed so easily; it is programmed to remain in the foreground. To get rid of it, press Ctrl+Alt+Esc on KDE and click on it. Before performing another test, run plymouth --quit.

Plymouth comes with a set of plugins that load PNG files. Unfortunately, these files are not documented. The naming conventions from the demo themes (packages plymouth-theme-<XXX>) can be used if necessary. However, almost all the themes available online use the Script plugin preinstalled by openSUSE, which comes with good documentation [4].

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News