Next:, Previous:, Up: 7 Theme file format 7.1 Introduction The GRUB graphical menu supports themes that can customize the layout and appearance of the GRUB boot menu. The theme is configured through a plain text file that specifies the layout of the various GUI components (including the boot menu, timeout progress bar, and text messages) as well as the appearance using colors, fonts, and images. Example is available in docs/exampletheme.txt 7.2 Theme Elements 7.2.1 Colors Colors can be specified in several ways:. HTML-style “#RRGGBB” or “#RGB” format, where.R.,.G., and.B. are hexadecimal digits (e.g., “#8899FF”). as comma-separated decimal RGB values (e.g., “128, 128, 255”).
with “SVG 1.0 color names” (e.g., “cornflowerblue”) which must be specified in lowercase. 7.2.2 Fonts The fonts GRUB uses “PFF2 font format” bitmap fonts. Fonts are specified with full font names. Currently there is no provision for a preference list of fonts, or deriving one font from another. Fonts are loaded with the “loadfont” command in GRUB. To see the list of loaded fonts, execute the “lsfonts” command. If there are too many fonts to fit on screen, do “set pager=1” before executing “lsfonts”.
![Grub Grub](/uploads/1/2/5/3/125359796/576935548.png)
7.2.3 Progress Bar. Figure 7.2 Progress bars are used to display the remaining time before GRUB boots the default menu entry. To create a progress bar that will display the remaining time before automatic boot, simply create a “progressbar” component with the id “timeout”.
This indicates to GRUB that the progress bar should be updated as time passes, and it should be made invisible if the countdown to automatic boot is interrupted by the user. Progress bars may optionally have text displayed on them.
This text is controlled by variable “text” which contains a printf template with the only argument%d is the number of seconds remaining. Additionally special values “@TIMEOUTNOTIFICATIONSHORT@”, “@TIMEOUTNOTIFICATIONMIDDLE@”, “@TIMEOUTNOTIFICATIONLONG@” are replaced with standard and translated templates. 7.2.4 Circular Progress Indicator The circular progress indicator functions similarly to the progress bar. When given an id of “timeout”, GRUB updates the circular progress indicator’s value to indicate the time remaining. For the circular progress indicator, there are two images used to render it: the.center. image, and the.tick.
image. The center image is rendered in the center of the component, while the tick image is used to render each mark along the circumference of the indicator. 7.2.5 Labels Text labels can be placed on the boot screen. The font, color, and horizontal alignment can be specified for labels. If a label is given the id “timeout”, then the “text” property for that label is also updated with a message informing the user of the number of seconds remaining until automatic boot.
This is useful in case you want the text displayed somewhere else instead of directly on the progress bar. 7.2.6 Boot Menu The boot menu where GRUB displays the menu entries from the “grub.cfg” file.
7 Theme file format 7.1 Introduction. The GRUB graphical menu supports themes that can customize the layout and appearance of the GRUB boot menu. The theme is configured through a plain text file that specifies the layout of the various GUI components (including the boot menu, timeout progress bar, and text messages) as well as the appearance.
It is a list of items, where each item has a title and an optional icon. The icon is selected based on the.classes. specified for the menu entry. If there is a PNG file named “myclass.png” in the “grub/themes/icons” directory, it will be displayed for items which have the class.myclass. The boot menu can be customized in several ways, such as the font and color used for the menu entry title, and by specifying styled boxes for the menu itself and for the selected item highlight.
7.2.7 Styled Boxes One of the most important features for customizing the layout is the use of.styled boxes. A styled box is composed of 9 rectangular (and potentially empty) regions, which are used to seamlessly draw the styled box on screen: Northwest (nw) North (n) Northeast (ne) West (w) Center (c) East (e) Southwest (sw) South (s) Southeast (se) To support any size of box on screen, the center slice and the slices for the top, bottom, and sides are all scaled to the correct size for the component on screen, using the following rules:.
The edge slices (north, south, east, and west) are scaled in the direction of the edge they are adjacent to. For instance, the west slice is scaled vertically. The corner slices (northwest, northeast, southeast, and southwest) are not scaled.
The center slice is scaled to fill the remaining space in the middle. As an example of how an image might be sliced up, consider the styled box used for a terminal view.
Inspired by Dylan103's popular, and various 'Screenshot of the Month' threads, this thread is for posting Grub 2 themes. NEW GRUB 2.0 has just been released and includes it's own theme: starcraft Grub 2.0 is not in the Ubuntu repositories nor in use on any current release of Ubuntu, but if you want to compile it you can get the files from the following location: This is not designed to be a support thread. It's posted in the Community Cafe forum for a reason - it is not designed to be a 'How To' on building a theme. It's purpose is to provide a pre-built theme that can be used without a great deal of editing. The user will need to add icons, backgrounds, and additional fonts if necessary by the theme. The latter portion of this post will provide some general information about fonts, icons, and backgrounds. That will be the extent of general support information.
Rules for posting: I can't improve on KiwiNZ's rules on, so here they are:. Stay within the board rules, no matter how hot you may believe the wallpaper/screen shot to be. If you are going to quote, there isn't a need to quote an img-embeded picture - Just don't do it. Please just reference the post by page number/page link/etc.
Off Topic Posts will be edited or removed. The desktops thread is not to be used as a means to post explicit or suggestive, and provocative images (they must be safe for your kids and/or boss to see). Please help to keep the thread relevant and safe to browse for everyone. The moderators of this forum reserve the right to edit or remove your posts as necessary so they may comply with our Community Rule set.
Please use reduced-size thumbnails, out of respect for people running on lower bandwidth or screen resolutions. Any large image (as determined by me) will be removed! If you can't post a thumbnail, please use a text link to your image. ImageShack causes problems for users in some countries. Please use another image hosting service. If your image is removed, reread this section.
Themes posted to this thread may be used and modified without attribution. Additional information to include in your post:. If you have to install special files/fonts, please specify how to do it.
Provide the paths if images or files are not located in the same folder as the theme file. Background Image: Name/where you got it (with link would be nice). Icons: Name/where you got it (with link would be nice). Limited Support Information: (Remember this is not a support forum) This post provides some general information on background images, icons, and fonts. It is not meant to be a comprehensive guide to creating Grub 2 themes. For complete information on how to build themes, I refer you to forum member towheedm's excellent theming guide, which can be found from information in this link:.
Background Images Background images referenced in a theme file will override the background images listed in 05debiantheme and /etc/default/grub and, in Grub 1.99 and later, image files placed in the /boot/grub folder. Fonts The default Grub 2 font is based on /usr/share/grub/unicode.pf2 and is identified as 'Unknown Regular 16' when 'lsfonts' is run from the Grub command prompt.
This font is scaled based on the resolution set by Grub during boot (the higher the resolution, the smaller the font). Grub 2 in later versions uses the highest resolution (smallest font) available to it unless the user specifies a different resolution in the 'GRUBGFXMODE=' entry of the /etc/default/grub file. To see the fonts loaded by Grub 2, at the grub command prompt, run the following command. (To get to the grub command line, press 'c' while viewing the Grub 2 menu.). Code: lsfontsGrub 2 uses '.pf2' fonts. Other fonts can be converted to this format with the 'grub-mkfont' command (demonstrated later).
To create additional.pf2 fonts:. The fonts used by Ubuntu are generally stored in /usr/share/fonts and its subfolders. To find a specific font, you can use the locate command.
( Example: locate DejaVuSans.ttf ). Fonts can be placed directly in the same folder as the theme file (e.g. Theme.txt) or in a universal folder such as /boot/grub/fonts and linked to the folder containing the theme file. To import a font to a 'universal' grub font folder (which must be created first). Code: sudo ln -s /boot/grub/fonts/DejaVuSans-Bold-18.pf2 /boot/grub/themes/ubuntu/.
Icons. Icons are called based on a '-class xxxx' entry in a menuentry. The xxxx references a.png file in the icons folder. Do not include the extension (.png) in the class designation. Example: menuentry 'Ubuntu, with Linux 3.0.0-7-generic' -class ubuntu.
Icons should be stored in an 'icons' folder in the same folder as the theme.txt. Grub 2 will automatically look in the icons folder for referenced icons. Icons will be scaled according to the information in the theme.txt. Grub 2 automatically uses the icon image in the icons folder with the same name as the '-class' designation in the menuentry. Default classes may include:.
10linux: ubuntu, gnu-linux, gnu, os. 30os-prober: gnu-linux, gnu, os, windows (if found). Icons for many popular OS's can be found in towheedm's Grub 2 Theming Guide (see Links section). For example, if the menuentry contains '-class ubuntu', Grub 2 will look for an icon in the icons folder named 'ubuntu.png' Do not use the '.png' extension if creating a custom '-class' entry. The user may create his own '-class' and place the.png file in the icons folder. Example: '-class myclass' with 'myclass.png' placed in the icons folder.
LINKS: by forum member towheedm A sample Grub 2 Theme created using towheedm's guide. This is a very simple theme to get you started. It was created with the help of the Grub Theming Guide by forum member towheedm referenced in the following thread. I have removed a lot of the commented lines of the example theme to make it short and simple.
Theme Path/Name: /boot/grub/themes/ubuntu/theme-drs305.txt Font Folder: None. Only the default Grub 2 font is used. (unicode.pf2, reported as 'Unknown Regular 16' by the lsfonts command at the grub prompt) Icons Location: /boot/grub/themes/ubuntu/icons Background Image: /boot/grub/themes/ubuntu/drs305.png. GIMP used to make the background of the icon images transparent. Special instructions:. /etc/default/grub entry: GRUBTHEME=/boot/grub/themes/ubuntu/drs305-theme.txt.
Icons are determined by a '-class' entry in /boot/grub/grub.cfg The default '-class' is 'ubuntu' for entries located in the 10linux section of grub.cfg. Notes:.
The menuentries are from a custom file, which accounts for the non-standard names and order. The background image and most icons are hand-made. The 'ubuntu' and 'windows' icons are available via the Grub Theming Guide referenced earlier. Theme Content (drs305-theme.txt).
Here's an expanded version of Post # 2, with a circular timer added. The additional entries are listed in bold. The screenshot actually includes 3 different images - take your pick (just remove the other two sections in the theme) and adjust the 'left' and 'top' variables to place it where you wish it to appear. To add the center image: Add a center image to the theme folder (/boot/grub/themes/ubuntu). The three examples I copied from Ubuntu system folders are.
/usr/share/app-install/icons/xfce4-clock.png. /usr/share/app-install/icons/alarm-clock.png. /usr/share/app-install/icons/gworldclock.png Add a tick image. I extracted the tick.png image from the Grub 2 Theming Guide's demo folder. The number of 'ticks' is set by the 'ticknum' setting. In this example, the number was 10, several of which have already disappeared as the timer counted down.
Geometry:. Placement is set by the variables in the '+ circular progress' section. The center image will be the size of the icon. Adjust the icon image with an image editor such as GIMP if you wish to change the center image size. The ticks will be displaced around a circle whose diameter is set by the pixel distance designated in the 'width' line.
While the examples all have the tick marks outside the center image, you can set the 'width' smaller and have the tick marks actually appear inside the clock face with some experimentation. See the far right clock image.
The distance from the left border is set by the 'left' variable. It can be designated by pixels, percentage, or both.
The distance from the top is set by the 'top' variable (% or pixels from the top of the screen). ^The 'start angle = -56' sets the first tick to disappear as the one at approximately 1 o'clock.
In posting this theme, I've used 'code' tags rather than 'quote' tags to save space. I'd have expected at least a few GRUB themes posted by now. Here's a theme I created from the metacity/gtk+-2.0 theme 'Azenis' which can be found. The GRUB theme shows best at 1024x768.
To install the theme, first extract the archive, cd to the directory where the archive was extracted to and run the 'install.sh' script.Thanks towheedm! I've actually used your guide to create numerous themes but none are significantly different from what you have in your guide. I'd hoped there would be some more postings here as well, as using your tools and Grub 2's capabilities one can make some pretty interesting boot menus.