DRAWER.LUA(8)
β¨ DRAWER.LUA β¨
bestie. welcome to the System Manager's Manual entry for the one and only drawer.lua β literally the module that makes your bootloader menu look cute. no cap, this thing draws menus, logos, and brands to the screen and it's giving main character energy π
π NAME π
drawer.lua β bootloader menu/screen drawer module
πΈ DESCRIPTION πΈ
okay so drawer.lua contains functionality for drawing and manipulating the menu, logo, and brand to the screen. it's literally the glow-up department of your bootloader.
before you can use any of the functionality provided by drawer.lua, you must include it with a statement such as the following:
local drawer = require("drawer")
no cap, you can't skip this step. it's the vibe check before the vibe. β¨
π BRAND DEFINITIONS π
brand definitions describe a "brand", traditionally drawn above the menu. the exact position may be controlled by using the loader.conf(5) variables loader_brand_x and loader_brand_y. the following keys may be defined for a brand definition:
graphicβ a table of strings containing rows of text to be drawn to the screen.
that's it. that's the whole brand def. iconic behavior honestly. π«Ά
π¦ LOGO DEFINITIONS π¦
logo definitions describe a "logo", traditionally to the right of the menu. the exact position may be controlled by using the loader.conf(5) variables loader_logo_x and loader_logo_y. the following keys may be defined for a logo definition:
requires_colorβ a boolean describing whether or not this logo definition requires color. if it is chosen to be drawn and it requires color on a color-disabled boot,drawer.luawill elect to use the default"orbbw"logo rather than the chosen logo.graphicβ a table of strings containing rows of text to be drawn to the screen.shiftβ a table describing the x and y shift that should be applied to all elements should this logo be selected. this is typically used for shifting the menu and brand if an empty or minimal logo are selected.
like, requires_color is lowkey the bouncer at the club β if your boot isn't serving color, you're not getting in with that logo, bestie. you're getting the default "orbbw" instead. periodt. π
π§ CUSTOM BRANDS AND LOGOS π§
the brand and logo system is designed to allow brands and logos to be easily plugged in. it's giving plug-and-play, it's giving modular, it's giving slay.
when an unrecognized loader_brand or loader_logo are encountered, drawer.lua will attempt to include brand-${loader_brand}.lua or logo-${loader_logo}.lua respectively. these files are expected to call either drawer.addBrand() or drawer.addLogo() to add the requested branddef or logodef.
drawer.lua will attempt to do another lookup for the requested brand or logo before falling back to one of the following:
drawer.default_brandβ the default brand to be used if the requested brand cannot be located.drawer.default_color_logodefβ the default logodef to be used if an invalid logodef is requested andloader(8)has been configured to allow output of color.drawer.default_bw_logodefβ the default logodef to be used if either an invalid logodef has been requested, or a logodef has been requested that requires color andloader(8)has been configured to not output color.
so like, if your custom brand is missing in action, drawer.lua isn't gonna leave you hanging β it's got backup plans on backup plans. fr fr. π
π FRAME STYLES π
drawer.lua contains the definitions for the different frame styles that may be drawn around the menu. frame styles define the characters drawn for horizontal lines, vertical aligns, and each of the four corner styles. the following keys may be defined for a frame style:
horizontalverticaltop_leftbottom_lefttop_rightbottom_right
frame styles are currently defined in the table drawer.frame_styles indexed by the name used for loader_menu_frame. no API currently exists for manipulating this table indirectly.
lowkey a warning bestie: there's literally no API for messing with this table indirectly. you're on your own if you go poking around in there. proceed with caution. π
π EXPORTED FUNCTIONS π
the following functions are exported from drawer.lua:
drawer.addBrand(name, def)β add the brand definition described by def to the table of known brand definitions, indexed by name.drawer.addLogo(name, def)β add the logo definition described by def to the table of known logo definitions, indexed by name.drawer.drawscreen(menudef)β draws the logo, brand, menu frame, and the current menu as described in menudef, formatted as defined bymenu.lua(8).
these three functions are the whole squad. addBrand and addLogo are the recruiters, drawscreen is the one that actually shows up and does the work. main character energy. β
π SEE ALSO π
go read that one too, bestie. it's the sibling page. iykyk. π«Ά
π AUTHORS π
the drawer.lua file was originally written by Pedro Souza <pedrosouza@FreeBSD.org>. later work and this manual page was done by Kyle Evans <kevans@FreeBSD.org>.
we stan. absolute icons. π
and that's the whole page, bestie!! this was Debian's very own DRAWER.LUA(8) from March 29, 2025 β go forth and draw those menus, logos, and brands with confidence. you're gonna slay. πβ¨π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- π the page's license: BSD-2-Clause
- Copyright (c) 2018 Kyle Evans <kevans@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms