mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-04 12:14:19 +01:00
WM (Linux): supports Umbriel version detection (#2594)
This commit is contained in:
@@ -168,6 +168,17 @@ static const char* getNiri(FFstrbuf* result) {
|
||||
return "Failed to run command `niri --version`";
|
||||
}
|
||||
|
||||
static const char* getUmbriel(FFstrbuf* result) {
|
||||
if (ffProcessAppendStdOut(result, (char* const[]) { "umbriel", "--version", nullptr }) == nullptr) { // umbriel 0.1.0 (7a448abe550e)
|
||||
ffStrbufSubstrAfterFirstC(result, ' ');
|
||||
ffStrbufSubstrBeforeLastC(result, '(');
|
||||
ffStrbufTrimRightSpace(result);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return "Failed to run command `umbriel --version`";
|
||||
}
|
||||
|
||||
static const char* getWeston(FFstrbuf* result) {
|
||||
FF_STRBUF_AUTO_DESTROY path = ffStrbufCreate();
|
||||
const char* error = ffFindExecutableInPath("weston", &path);
|
||||
@@ -327,6 +338,10 @@ const char* ffDetectWMVersion(const FFstrbuf* wmName, FFstrbuf* result, [[maybe_
|
||||
return getNiri(result);
|
||||
}
|
||||
|
||||
if (ffStrbufEqualS(wmName, "umbriel")) {
|
||||
return getUmbriel(result);
|
||||
}
|
||||
|
||||
if (ffStrbufEqualS(wmName, "weston")) {
|
||||
return getWeston(result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user