
You can install grub2-theme-preview, which is a PyPi package. It uses QEMU and seems to work well for testing grub themes and this without having to restart after every change.
It's also available directly from AUR, which is the version I used, as I'm using Manjaro.
It requires the following non-PyPi dependencies (see README.md for links, more details and potential updates):
- grub-mkrescue of GRUB 2 (package grub-common on Debian and Ubuntu)
- QEMU — hypervisor that performs hardware virtualization
- OVMF — EFI bios image for use with QEMU
- mtools — collection of utilities to access MS-DOS
- xorriso of libisoburn — frontend which enables creation and expansion of the ISO format
- And python / pip, of course
To install, run the following command:
pip install --user grub2-theme-preview
Once installed you can run grub2-theme-preview /path/to/your/theme/directory
from the terminal to launch it (more on usage here.)
Note: if you have any custom configs, e.g. custom.cfg or, say, liveiso.cfg, that you pull into your grub.cfg separately, thanks to the script in /etc/grub.d/41_custom, for example, their entries may not show up, in which case you'll need to use the newly added --add flag. Your command might look like the following, with --add TARGET=/SOURCE for each custom config you want added:
grub2-theme-preview --verbose --grub-cfg /boot/grub/grub.cfg --add /boot/grub/custom.cfg=/boot/grub/custom.cfg --add /boot/grub/gpu-switcher.cfg=/boot/grub/gpu-switcher.cfg --add /boot/grub/liveiso.cfg=/boot/grub/liveiso.cfg /usr/share/grub/themes/manjaro
More context here: https://github.com/hartwork/grub2-theme-preview/issues/29#issuecomment-980802808
You can also check out the answers here if you want something a bit more terminal centric and only needing to see order. This awk command, for example, will give you entries and sub entries as well:
awk -F\' '/(^|| )nuentry / {print $2}' /boot/grub/grub.cfg|cat -n|awk '{print $1-1,$1="",$0}'
Source
I like these options better than grub-emu
, as that seems to have an issue closing, without having to close your terminal completely, as mentioned in the comments of that answer. Plus, grub2-theme-preview will actually show you the theme (although it does require more dependency setup) and the awk command is quick and easy; perhaps add it as an alias if you use it often so you don't have to remember it.
reboot
orexit
command in GRUB? – daisy Nov 19 '17 at 02:27c
(for grub prompt) and thenexit
the Shell-prompt is missing, typereset
(a command from 'terminfo') and ENTER to get it back. – Hannu Nov 19 '17 at 17:08grub.cfg
you can control if the emulator launches in the terminal or in a separate window with the commandterminal_output [output]
. Whereoutput
can beconsole
,gfxterm
or both. – Alberto Salvia Novella Feb 27 '24 at 11:07