From 350aa37c1b6f2703f5585522a64931f21ac2d619 Mon Sep 17 00:00:00 2001 From: Niklas080208 Date: Tue, 3 Feb 2026 19:08:54 +0100 Subject: [PATCH] Added OmniNX Version indicator in nyx using manifest --- .DS_Store | Bin 8196 -> 10244 bytes nyx/nyx_gui/frontend/gui.c | 67 +++++++++++++++++++++++++++++++++++-- 2 files changed, 64 insertions(+), 3 deletions(-) diff --git a/.DS_Store b/.DS_Store index 6e85d6828806e73d79440329aab24d78bf998896..0630b33486643e90cb4221c3c4fd6949915720ce 100644 GIT binary patch delta 1487 zcmaKs&u`LT7{?!4epJS^&2X6+$x3#?NN^CcxOf;EJZPfgyy(F!A`7~;6edI$Lh50O ziOxi9)a>Sepvb`x4|>y^H_sl7UKc%hm@z(Y3-o>Hwh-R8?f3ik`{8*X-p$-*VG00z zXB(w7fQpwAe%UNX+O^4cDy}5)#)tQymD5*m8G5x-dl70sP`V+>FPTjBLkh}p2kHX{ zJ_A^ZKIb*v$mffiQN(9bZ}sn&^DjT0p?c{+y?Wb8$29=u92-R_noxo@5}W;AcO<6p zp*N0S>@7N>xX@AENUur)7Yi&fjOz^i)Ir1XCceX5fproes4nekL>~|1-yOnuUut_@ zw1d1RpqY>c-!Reuk~VNlG$;|g&#`}0<)M~m-%sb93UTXo!$t8pOgn-Ae0{|Lg2NJx zRw#TSJgV~$r|!KQK#+Iv7_P^pK?G#X-m?(sxK|~thK9AeORAydUn9zhgNHfs=+dBP zJTAK`rrpo`+X#@d!zv>}1vcP50hx$jcNHF>S-Cs_=&$4J(5$GVG6{@61uG&?`+8PF zt|g8&o0&{zA*p85^R1-XT*%Df^?bI~IwT#PJ$ZU*c}>$R#$)TFJQLqSo*)*kfz4iJ zBjFwYnX=N+iSBQCDtL|Ojcq;K=(iAA%~S8^A?Sx?uy!YBOcB;S+ZOrt(5{xP@aX}e z;8v@zy3OlVN#eNOE&=?#>@Ti4t)jC755oWi;{%SI%m@F74TFip4d2^A0EC@R?VG5G sb{wc6d)@Bitm_wK)8@wqPp7Dz(7aA#MpAOt%x*Z*W^eMdB*O| zGexx7ChJJ^PfU3$$P82s1QOgp!WCrs#>DT;llfHwIe=D!oWw9Wo@eUjZ4!J;5G}6& DWA diff --git a/nyx/nyx_gui/frontend/gui.c b/nyx/nyx_gui/frontend/gui.c index 00b18eae..f49f908a 100644 --- a/nyx/nyx_gui/frontend/gui.c +++ b/nyx/nyx_gui/frontend/gui.c @@ -2010,18 +2010,79 @@ failed_sd_mount: return LV_RES_OK; } +// Fills buf with theme-colored brand text: "hekate | OmniNX X.X.X Pack" from manifest.ini, or "hekate" if missing. +static void _get_home_brand_text(char *buf, size_t buf_size) +{ + static const char * const manifest_paths[] = { + "config/omninx/manifest.ini", + "bootloader/config/omninx/manifest.ini", + }; + // SD is unmounted when the main menu is built; mount so we can read the manifest. + sd_mount(); + link_t ini_sections; + list_init(&ini_sections); + int parsed = 0; + for (u32 p = 0; p < sizeof(manifest_paths) / sizeof(manifest_paths[0]) && !parsed; p++) + parsed = ini_parse(&ini_sections, manifest_paths[p], false); + if (!parsed) + { + s_printf(buf, "%s%s", text_color, " hekate#"); + return; + } + const char *version = NULL; + const char *pack = NULL; + LIST_FOREACH_ENTRY(ini_sec_t, ini_sec, &ini_sections, link) + { + if (ini_sec->type != INI_CHOICE) + continue; + // Accept [OmniNX] or [omninx] (case-insensitive). + const char *n = ini_sec->name; + if ((n[0] != 'O' && n[0] != 'o') || (n[1] != 'm' && n[1] != 'M') || + (n[2] != 'n' && n[2] != 'N') || (n[3] != 'i' && n[3] != 'I') || + (n[4] != 'N' && n[4] != 'n') || (n[5] != 'X' && n[5] != 'x') || n[6] != '\0') + continue; + LIST_FOREACH_ENTRY(ini_kv_t, kv, &ini_sec->kvs, link) + { + if (!strcmp(kv->key, "version")) + version = kv->val; + else if (!strcmp(kv->key, "current_pack")) + pack = kv->val; + else if (!pack && !strcmp(kv->key, "channel_pack")) + pack = kv->val; + } + break; + } + ini_free(&ini_sections); + if (!version || !pack) + { + s_printf(buf, "%s%s", text_color, " hekate#"); + return; + } + // Capitalize first letter of pack for display (e.g. light -> Light). + char pack_display[24]; + size_t i = 0; + while (pack[i] && i < sizeof(pack_display) - 1) + { + pack_display[i] = (i == 0 && pack[0] >= 'a' && pack[0] <= 'z') + ? (char)(pack[0] - 'a' + 'A') : pack[i]; + i++; + } + pack_display[i] = '\0'; + s_printf(buf, "%s hekate | OmniNX %s %s#", text_color, pack_display, version); +} + static void _create_tab_home(lv_theme_t *th, lv_obj_t *parent) { lv_page_set_scrl_layout(parent, LV_LAYOUT_OFF); lv_page_set_scrl_fit(parent, false, false); lv_page_set_scrl_height(parent, 592); - char btn_colored_text[64]; + char btn_colored_text[96]; - // Set brand label. + // Set brand label (from OmniNX manifest if present, else "hekate"). lv_obj_t *label_brand = lv_label_create(parent, NULL); lv_label_set_recolor(label_brand, true); - s_printf(btn_colored_text, "%s%s", text_color, " hekate#"); + _get_home_brand_text(btn_colored_text, sizeof(btn_colored_text)); lv_label_set_text(label_brand, btn_colored_text); lv_obj_set_pos(label_brand, 50, 48);