a1ive/grub

Query: Are variables in a theme .txt file supported?

Closed this issue · 2 comments

In Ventoy, themes seem to be able to use variables in their .txt files, e.g.

+ hbox{ 
    left = 30%
    top = 95%
    width = 10%
    height = 25
    + label {text = "@HOTKEY_TIP@" color = "blue" align = "left"} 
}

This does not seem to work in a1ive grub2. Is there some trick?

a1ive commented

https://github.com/ventoy/Ventoy/blob/784e3ae8794b51cc9924b0bbb65ba41beb6e6bd4/GRUB2/MOD_SRC/grub-2.04/grub-core/gfxmenu/gui_label.c#L211

You can use @@VAR in my grub2.
https://github.com/a1ive/grub2-filemanager/blob/fb85b3a8a76137ceaa230cc2a9dc7cbf37032d09/boot/grubfm/themes/slack/help.txt#L21
Note, however, that the displayed strings are static, and once the theme is loaded, the screen display will not change even if you change the values of the variables.

a1ive commented

It is now possible to use the experimental new github feature "discussion" to ask questions, if not bugs or feature requests.
https://github.com/a1ive/grub/discussions