WM (Linux): supports Umbriel version detection (#2594)

This commit is contained in:
Ian Ribeiro
2026-09-18 00:42:19 -03:00
committed by GitHub
parent 70d2dd37a6
commit 560a9f419d
2 changed files with 16 additions and 0 deletions
+15
View File
@@ -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);
}