Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Customize the grub theme

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

1 Overview

Custom grub boot menu theme, the author's linux is deepin, feel that the default grub theme is not very good-looking, um, no way, just want to change.

The main purpose of this article is to modify the two files / boot/grub/grub.cfg and / boot/grub/themes/.../theme.txt. Back up before modification, don't ask why.

2 download theme

Come here to download your favorite theme. This is the theme downloaded by the author.

3 decompress tar-zxvf xxxx.tar.gz4 installation

Run directly in the unzipped folder:

Sudo. / install.sh

Enter y:

5 effect

6 improvement

Not satisfied yet, uh-huh.

6.1 progress_bar

This is the setting of the progress bar. If you are not satisfied with the progress bar, you can directly modify the progress_bar setting under / boot/grub/themes/ topic name / theme.txt:

You can change the position (from the left and top), width, height, whether to display the text, set the text, etc., you can also set the foreground color (fg_color) and background color (bg_color), as well as the style of the progress bar, that is, which pictures are displayed.

6.2 boot_menu

This is the startup menu settings, you can adjust the location of the startup item, font size, startup item height, the interval between the startup items, the size of the icon before the startup item, and so on.

6.3 image

The author's theme.txt has an image to display the KDElogo. You can choose not to do it and delete all of it. If you want to change it to your favorite image, you can directly change the file location or create a new image:

If it is your own file, you need to put the pictures in the same folder as theme.txt, other width, height, etc., as long as the setting is appropriate.

6.4 / etc/default/grub

Some of the system-related basically do not need to change, often change is the default item, timeout these.

GRUB_DEFAULT: set default startup items, sort by menuentry (menuentry order can be viewed through / boot/grub/grub.cfg), count from 0, important thing again is not from 1 count, if set to "saved" means to save the last item, need to be used with GRUB_SAVEDEFULT. GRUB_SAVEDEFAULT: this option takes effect only when GRUB_DEFAULT is set to "saved". The default is false. If set to true, the default startup item is the last startup item. GRUB_TIMEOUT: the waiting time for entering the default item (in seconds). The time when other keys are pressed will be canceled. The default is 5. Setting it to 0 means starting immediately. The startup menu will not be displayed. If set to-1, it means unlimited waiting. GRUB_TIMEOUT_STYLE: defaults to "menu" (not setting this value is equivalent to setting "menu"), which means that the startup item menu is displayed. If set to "countdown", the startup item menu will not be displayed, and a line of countdown text will be displayed. If set to "hidden", the effect is similar to "countdown", but the countdown text will not be displayed. Start the default startup item after waiting for the end of GRUB_TIMEOUT. If you set it to "countdown" or "hidden", you can press Esc to display the startup menu.

But in fact, there is a pit, that is, you only need to press Esc once to display the startup menu, once, and twice will enter the shell in grub. To seize the opportunity, press fast has no effect or will enter grub, press slow to start the default startup item directly, of course, it doesn't matter if the GRUB_TIMEOUT is a little larger, the author said that this is because I have experienced setting GRUB_TIMEOUT to 1. And then GRUB_TIMEOUT_STYLE is set to a situation like "hidden", and then it's tragic. If you want to go in and start the menu, you have to restart it several times. Therefore, GRUB_TIMEOUT_STYLE does not recommend setting it as "countdown" or "hidden". No, no, no.

There are other settings for / etc/default/grub, but they are not used very much. You can take a look at them here if you need to.

6.5 / boot/grub/grub.cfg

The file will be updated after update-grub, and the file will be modified manually because you want to change the text of the startup item, because it is too long to feel necessary.

Note that if you manually modify / etc/default/grub, that is, after you need to execute update-grub to make it effective, you need to modify / boot/grub/grub.cfg.

Sudo vim / boot/grub/grub.cfg

The author just wants to change the text, so search here and find menuentry to modify directly:

It would be nice to shorten it a little bit, submenu is the same:

6.6 background

This is relatively simple, then copy the desired background to / boot/grub/themes/ topic name /, rename it to background.png, or you can modify it in theme.txt:

7 final effect

This is the final effect of the author, mainly adding an avatar, changing the background and so on. (mobile phone problem.)

8 Profil

This is the required configuration file and theme.

Github

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report