DRAWER.LUA(8)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

✨ 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.lua will 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 and loader(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 and loader(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:

  • horizontal
  • vertical
  • top_left
  • bottom_left
  • top_right
  • bottom_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 by menu.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 πŸ“

menu.lua(8)

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