Skip to content

Feature: Optional per-class backgrounds for custom themes#3560

Open
DanGM96 wants to merge 5 commits intoventoy:masterfrom
DanGM96:master
Open

Feature: Optional per-class backgrounds for custom themes#3560
DanGM96 wants to merge 5 commits intoventoy:masterfrom
DanGM96:master

Conversation

@DanGM96
Copy link
Copy Markdown

@DanGM96 DanGM96 commented Apr 8, 2026

Extends the patched gfxmenu so a theme can change backgrounds depending on the highlighted menu entry’s classes, similar to how it's done for icons/.

How it works:

  • If the theme directory contains a backgrounds/ folder, the feature is enabled
  • For the selected entry, GRUB walks entry->classes and loads the first match: backgrounds/<class_name>.png
  • If no matching PNG exists for that entry, the view falls back to the default image (theme.txt desktop-image).

Notes:

  • If there is no backgrounds/ folder, it behaves the same as expected without this feature
  • When doing full redraw, you can notice a small delay
  • I tried optimizing it without going too far out of scope, but the line count still ended up bigger than I expected

How to add to themes

  • Simply add a backgrounds/ directory inside the theme file (same layout idea as icons/).
  • Create PNGs named after class strings (e.g. same classes as in menu_class / GRUB class on entries).

Inspired by https://github.com/elwint/grub-gfxmenu-bg-mod

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant