From d810815ed4e958f95fb935079a3dbf86da5ed474 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 14 Mar 2025 15:44:31 +0100 Subject: [PATCH] =?utf8?q?firstboot:=20welcome=20user=20with=20emoji=20in?= =?utf8?q?=20firstboot=20wizard=20=F0=9F=A7=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/basic/glyph-util.c | 2 ++ src/basic/glyph-util.h | 1 + src/firstboot/firstboot.c | 10 ++++++++-- src/home/homectl.c | 7 ++++++- src/test/test-locale-util.c | 3 ++- 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/basic/glyph-util.c b/src/basic/glyph-util.c index 64f6685cb4f..fa4c5888bd8 100644 --- a/src/basic/glyph-util.c +++ b/src/basic/glyph-util.c @@ -82,6 +82,7 @@ const char* special_glyph_full(SpecialGlyph code, bool force_utf) { [SPECIAL_GLYPH_GREEN_CIRCLE] = "o", [SPECIAL_GLYPH_SUPERHERO] = "S", [SPECIAL_GLYPH_IDCARD] = "@", + [SPECIAL_GLYPH_HOME] = "^", }, /* UTF-8 */ @@ -153,6 +154,7 @@ const char* special_glyph_full(SpecialGlyph code, bool force_utf) { [SPECIAL_GLYPH_GREEN_CIRCLE] = u8"🟢", [SPECIAL_GLYPH_SUPERHERO] = u8"🦸", [SPECIAL_GLYPH_IDCARD] = u8"🪪", + [SPECIAL_GLYPH_HOME] = u8"🏠", }, }; diff --git a/src/basic/glyph-util.h b/src/basic/glyph-util.h index ca4d4eda71a..84c01a5fedc 100644 --- a/src/basic/glyph-util.h +++ b/src/basic/glyph-util.h @@ -57,6 +57,7 @@ typedef enum SpecialGlyph { SPECIAL_GLYPH_GREEN_CIRCLE, SPECIAL_GLYPH_SUPERHERO, SPECIAL_GLYPH_IDCARD, + SPECIAL_GLYPH_HOME, _SPECIAL_GLYPH_MAX, _SPECIAL_GLYPH_INVALID = -EINVAL, } SpecialGlyph; diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c index cd72f543969..a5a6ff7a846 100644 --- a/src/firstboot/firstboot.c +++ b/src/firstboot/firstboot.c @@ -124,11 +124,17 @@ static void print_welcome(int rfd) { (void) terminal_reset_defensive_locked(STDOUT_FILENO, /* flags= */ 0); if (colors_enabled()) - printf("\nWelcome to your new installation of \x1B[%sm%s\x1B[0m!\n", ac, pn); + printf("\n" + ANSI_HIGHLIGHT "Welcome to your new installation of " ANSI_NORMAL "\x1B[%sm%s" ANSI_HIGHLIGHT "!" ANSI_NORMAL "\n", ac, pn); else printf("\nWelcome to your new installation of %s!\n", pn); - printf("\nPlease configure your system!\n"); + putchar('\n'); + if (emoji_enabled()) { + fputs(special_glyph(SPECIAL_GLYPH_SPARKLES), stdout); + putchar(' '); + } + printf("Please configure your new system!\n"); any_key_to_proceed(); diff --git a/src/home/homectl.c b/src/home/homectl.c index 65243e4a6fe..4ac53be2890 100644 --- a/src/home/homectl.c +++ b/src/home/homectl.c @@ -2710,7 +2710,12 @@ static int create_interactively(void) { return 0; } - printf("\nPlease create your user account!\n"); + putchar('\n'); + if (emoji_enabled()) { + fputs(special_glyph(SPECIAL_GLYPH_HOME), stdout); + putchar(' '); + } + printf("Please create your user account!\n"); if (!any_key_to_proceed()) { log_notice("Skipping."); diff --git a/src/test/test-locale-util.c b/src/test/test-locale-util.c index f9b2712444a..40d07597835 100644 --- a/src/test/test-locale-util.c +++ b/src/test/test-locale-util.c @@ -82,7 +82,7 @@ TEST(keymaps) { #define dump_glyph(x) log_info(STRINGIFY(x) ": %s", special_glyph(x)) TEST(dump_special_glyphs) { - assert_cc(SPECIAL_GLYPH_IDCARD + 1 == _SPECIAL_GLYPH_MAX); + assert_cc(SPECIAL_GLYPH_HOME + 1 == _SPECIAL_GLYPH_MAX); log_info("is_locale_utf8: %s", yes_no(is_locale_utf8())); @@ -135,6 +135,7 @@ TEST(dump_special_glyphs) { dump_glyph(SPECIAL_GLYPH_GREEN_CIRCLE); dump_glyph(SPECIAL_GLYPH_SUPERHERO); dump_glyph(SPECIAL_GLYPH_IDCARD); + dump_glyph(SPECIAL_GLYPH_HOME); } DEFINE_TEST_MAIN(LOG_INFO); -- 2.47.3