Logo (Builtin): Add HarmonyOS support (#1804)

* Logo (Builtin): add HarmonyOS

* OS (HarmonyOS): detect HarmonyOS

* Update src/detection/os/os_linux.c

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update os_linux.c

---------

Co-authored-by: Carter Li <CarterLi@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
ᡥᠠᡳᡤᡳᠶᠠ ᡥᠠᠯᠠ·ᠨᡝᡴᠣ 猫
2025-06-14 09:03:57 +08:00
committed by GitHub
parent f1cc2d124c
commit 2e1ddcf9f8
3 changed files with 42 additions and 1 deletions
+12 -1
View File
@@ -304,8 +304,19 @@ static void detectOS(FFOSResult* os)
parseOsRelease(FASTFETCH_TARGET_DIR_ETC "/os-release", os);
if (os->id.length == 0 || os->version.length == 0 || os->prettyName.length == 0 || os->codename.length == 0)
parseLsbRelease(FASTFETCH_TARGET_DIR_ETC "/lsb-release", os);
if (os->id.length == 0 || os->name.length > 0 || os->prettyName.length > 0)
if (os->id.length == 0 || os->name.length == 0 || os->prettyName.length == 0)
parseOsRelease(FASTFETCH_TARGET_DIR_USR "/lib/os-release", os);
if (os->id.length == 0 && os->name.length == 0 && os->prettyName.length == 0)
{
// HarmonyOS has no os-release file
if (ffStrbufEqualS(&instance.state.platform.sysinfo.name, "HarmonyOS"))
{
ffStrbufSetS(&os->id, "harmonyos");
ffStrbufSetS(&os->idLike, "harmonyos");
ffStrbufSetS(&os->name, "HarmonyOS");
ffStrbufSetS(&os->prettyName, "HarmonyOS");
}
}
}
void ffDetectOSImpl(FFOSResult* os)
+19
View File
@@ -0,0 +1,19 @@
....-----....
.-+##############+-..
.+######################+..
.########+- -++#######-.
.+######- -######+.
.######. .######..
.+####+ +#####..
.-####+. +####+.
.+####+ -####+..
..+####+ -####+...
$2......--$1+####+$2--.......................--$1+####+$2-.........
..$1--++++-$2...... ...$1-++++--$2..
..$1--+++--$2... ...$1-+++++-$2..
.$1--+++--$2.... ....$1--+++-$2...
..$1-++++++--$2..... ......$1---+---$2...
...$1-+++++++++-----$2..$1----++++++--$2..
...$1---++++++----++++++++---$2...
.....$1-----+++-----$2...
...$1---$2...
+11
View File
@@ -2186,6 +2186,17 @@ static const FFlogo H[] = {
.colorKeys = FF_COLOR_FG_RED,
.colorTitle = FF_COLOR_FG_RED,
},
// HarmonyOS
{
.names = {"HarmonyOS"},
.lines = FASTFETCH_DATATEXT_LOGO_HARMONYOS,
.colors = {
FF_COLOR_FG_WHITE,
FF_COLOR_FG_BLUE,
},
.colorKeys = FF_COLOR_FG_BLUE,
.colorTitle = FF_COLOR_FG_BLUE,
},
// Hash
{
.names = {"Hash"},