From: John Marino Date: Fri, 28 Nov 2014 22:07:46 +0000 (+0100) Subject: dloader: First step in improving looks of boot menu X-Git-Tag: v4.2.0rc~1374 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/a031988aa7e2e5fef9bac344a5affaf31205c214 dloader: First step in improving looks of boot menu The boot menu essentially hasn't changed since it was converted to C a few years ago. The line between Fred and menu always bugged me, but I suppose some people like it. I added a new loader option called "fred_separated" that is off by default, but if set on in loader.conf, it will bring back the line. When the line isn't present, Fred shifts over by two characters which makes him centered. While here, improve the colorization of Fred. Colorization is not turned on by default. Before that can happen, adequate detection for a serial console must be added to avoid using ansi color codes on it. Since Fred has always been depicted as a red DragonFly with red wings, he has been given bright red wings against a darker red body, and eyes have changed from green yellow. His shape has been tweaked as well. His scorpion stinger was sanded down to a small point and his mosquito beak was made shorter so his head looks more like a DragonFly. His thorax was improved with curly brackets. The original look can be restored by putting this in /boot/loader.conf: fred_separated="YES" Approved by: Positive feedback on IRC channel --- diff --git a/sys/boot/dloader/cmds.c b/sys/boot/dloader/cmds.c index 8f8ea5ac4d..995ecb74b0 100644 --- a/sys/boot/dloader/cmds.c +++ b/sys/boot/dloader/cmds.c @@ -456,31 +456,31 @@ command_menu(int ac, char **av) static char *logo_blank_line = " "; static char *logo_color[LOGO_LINES] = { - " ,--, | ,--, ", - " | `-, ,^, ,-' | ", - " `, `-, (/ \\) ,-' ,' ", - " `-, `-,/ \\,-' ,-' ", - " `------( )------' ", - " ,----------( )----------, ", - " | _,-( )-,_ | ", - " `-,__,-' \\ / `-,__,-' ", - " | | ", - " | | ", - " | | ", - " | | ", - " | | ", - " | | ", - " `|' ", + " ,--, ,--, ", + " | `-, _:_ ,-' | ", + " `, `-, (/ \\) ,-' ,' ", + " `-, `-,/ \\,-' ,-' ", + " `------{ }------' ", + " ,----------{ }----------, ", + " | _,-{ }-,_ | ", + " `-,__,-' \\ / `-,__,-' ", + " | | ", + " | | ", + " | | ", + " | | ", + " | | ", + " | | ", + " `,' ", " " }; static char *logo_mono[LOGO_LINES] = { - " ,--, | ,--, ", - " | `-, ,^, ,-' | ", + " ,--, ,--, ", + " | `-, _:_ ,-' | ", " `, `-, (/ \\) ,-' ,' ", " `-, `-,/ \\,-' ,-' ", - " `------( )------' ", - " ,----------( )----------, ", - " | _,-( )-,_ | ", + " `------{ }------' ", + " ,----------{ }----------, ", + " | _,-{ }-,_ | ", " `-,__,-' \\ / `-,__,-' ", " | | ", " | | ", @@ -488,18 +488,18 @@ static char *logo_mono[LOGO_LINES] = { " | | ", " | | ", " | | ", - " `|' ", + " `,' ", " " }; static void -logo_display(char **logo, int line, int orientation) +logo_display(char **logo, int line, int orientation, int barrier) { const char *fmt; if (orientation == FRED_LEFT) - fmt = "%s | "; + fmt = barrier ? "%s | " : " %s "; else - fmt = " | %s"; + fmt = barrier ? " | %s" : " %s "; if (logo != NULL) { if (line < LOGO_LINES) @@ -515,6 +515,7 @@ menu_display(void) dvar_t dvar; int i; int logo_left = 0; /* default to fred on right */ + int separated = 0; /* default no line b/w fred & menu */ char **logo = logo_mono; if (dvar_istrue(dvar_get("loader_color"))) @@ -526,16 +527,24 @@ menu_display(void) if (dvar_istrue(dvar_get("fred_on_left"))) logo_left = 1; + if (dvar_istrue(dvar_get("fred_separated"))) + separated = 1; + dvar = dvar_first(); i = 0; - if (logo != NULL) - printf(logo_left ? "%35s|%43s\n" : "%43s|%35s\n", " ", " "); - + if (logo != NULL) { + if (logo_left) + printf(separated ? "%35s|%43s\n" : "%35s %43s\n", + " ", " "); + else + printf(separated ? "%43s|%35s\n" : "%43s %35s\n", + " ", " "); + } while (dvar || i < LOGO_LINES) { if (logo_left) - logo_display(logo, i, FRED_LEFT); + logo_display(logo, i, FRED_LEFT, separated); while (dvar) { if (strncmp(dvar->name, "menu_", 5) == 0) { @@ -548,13 +557,13 @@ menu_display(void) } /* * Pad when the number of menu entries is less than - * LOGO_LINES. + * LOGO_LINES. */ if (dvar == NULL) printf(" %38.38s", " "); if (!logo_left) - logo_display(logo, i, FRED_RIGHT); + logo_display(logo, i, FRED_RIGHT, separated); printf("\n"); i++; } diff --git a/sys/boot/dloader/loader.conf b/sys/boot/dloader/loader.conf index b363260742..95fc18f916 100644 --- a/sys/boot/dloader/loader.conf +++ b/sys/boot/dloader/loader.conf @@ -41,6 +41,7 @@ bitmap_type="splash_image_data" # and place it on the module_path #autoboot_delay="10" # Delay in seconds before autobooting #fred_disable="NO" # Turn Fred's boot menu on and off +#fred_separated="NO" # Place line between Fred and menu #fred_on_left="NO" # Show Fred on left side of menu #loader_color="NO" # Set to YES for a color version of Fred #console="vidconsole" # Set the current console