Easily create custom 9-slice menu boxes, highlight assets, and progress bars for any GRUB theme—no graphic design required!
GRUB Styled Box Generator is a Python tool for anyone designing a GRUB theme.
It interactively generates the 9-slice image assets needed for GRUB menu boxes, highlights, and progress bars.
The script is fully customizable—choose your dimensions, colors, border styles, and more.
Whether you want classic, Y2K, cyberfunk, neon, minimal, or any other look, this tool helps you rapidly prototype and produce styled box images for your GRUB theme.
No need to use Inkscape or slice images manually—just answer a few prompts!
- Interactive setup: Select menu box, highlight, progress bar, or all at once.
- Customizable colors & dimensions: Define fill/glow, border, highlight overlays, and slice sizes.
- Border styles: Solid, dashed, or double—pick for each asset set.
- Font support: Use a default or specify your own font file.
- Preview mockup: Instantly visualize your assembled box as it will appear in GRUB.
- Batch generation: Create multiple asset sets in one run.
- Standard output: PNG images named for GRUB’s 9-slice system (
slice_nw.png,slice_c.png, etc.) and preview images. - General-purpose: Works for any style or color palette—perfect for all users, not just for a specific aesthetic.
-
Install Python 3.7+
-
Install Pillow (Python Imaging Library):
pip install pillow
-
Download
styled_box_generator.py(see script here).
Run the generator script:
python styled_box_generator.pyThe script will interactively guide you through:
- Selecting which box type(s) to generate (menu, highlight, progress bar, or all)
- Entering dimensions (or using defaults)
- Choosing colors (or using defaults)
- Picking border style (solid, dashed, double)
- Optionally specifying a font
- Setting preview/mockup size
Example Session:
Which box type do you want to generate? (1-4) [default: 4]:
Corner (nw, ne, sw, se) [default: 32,32]:
Fill/Glow color (hex or R,G,B) [default: #ff66ff]:
Border/Stroke color (hex or R,G,B) [default: #00ccff]:
Highlight overlay color (hex or R,G,B) [default: #ffffff]:
Choose border style (1/2/3) [default: 1]:
...
Preview saved to menu_box/preview_box.png
All slices for 'menu box' saved to menu_box/
- 9 slice PNGs per box type:
slice_nw.png,slice_n.png,slice_ne.png,slice_w.png,slice_c.png,slice_e.png,slice_sw.png,slice_s.png,slice_se.png - Preview mockup:
preview_box.png(shows the full assembled box as it will look in GRUB)
- Dimensions: Choose pixel sizes for corners, sides, center, and preview.
- Colors: Any valid hex (
#RRGGBB) or RGB (R,G,B) values. - Border Styles:
solid: Clean, strong outlinedashed: Retro, glitchy vibesdouble: Layered, cyber borders
- Font: Use default or specify a path to a TTF/OTF font file.
- Batch Generation: Generate all box types at once.
(Add your generated preview images here!)
- Built with: Python & Pillow
- Works on: Any OS with Python and Pillow
- For: Any GRUB theme creator—classic, modern, neon, Y2K, minimalist, you name it!
- Script by: Lumexio
- Inspired by: GRUB theme creators everywhere!
- Docs Used: GRUB Theme Documentation
MIT (or specify your preferred license)
Issues, ideas, and pull requests welcome!