mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-30 00:37:23 +01:00
WIP: shepherd initsystem
This commit is contained in:
@@ -48,7 +48,7 @@ const char* ffDetectInitSystem(FFInitSystemResult* result)
|
||||
|
||||
if (instance.config.general.detectVersion)
|
||||
{
|
||||
#if __linux__ && !__ANDROID__
|
||||
#if (defined(__linux__) && !defined(__ANDROID__)) || defined(__GNU__)
|
||||
if (ffStrbufEqualS(&result->name, "systemd"))
|
||||
{
|
||||
ffBinaryExtractStrings(result->exe.chars, extractSystemdVersion, &result->version, (uint32_t) strlen("systemd 0.0 running in x"));
|
||||
@@ -84,6 +84,20 @@ const char* ffDetectInitSystem(FFInitSystemResult* result)
|
||||
ffStrbufSubstrAfterLastC(&result->version, ' ');
|
||||
}
|
||||
}
|
||||
else if (ffStrbufEqualS(&result->name, "guile"))
|
||||
{
|
||||
/* TODO: guile is actually shepherd */
|
||||
if (ffProcessAppendStdOut(&result->version, (char* const[]) {
|
||||
ffStrbufEndsWithS(&result->exe, "/guile") ? result->exe.chars : "guile",
|
||||
"--version",
|
||||
NULL,
|
||||
}) == NULL && result->version.length)
|
||||
{
|
||||
/* guile (GNU Guile) 3.0.9 */
|
||||
ffStrbufSubstrBeforeFirstC(&result->version, '\n');
|
||||
ffStrbufSubstrAfterLastC(&result->version, ' ');
|
||||
}
|
||||
}
|
||||
#elif __APPLE__
|
||||
if (ffStrbufEqualS(&result->name, "launchd"))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user