mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-27 23:30:47 +01:00
WM (Linux): supports Umbriel version detection (#2594)
This commit is contained in:
@@ -51,6 +51,7 @@ Features:
|
||||
* Improved reliability of fastfetch's built-in HTTP client. (PublicIP, Weather)
|
||||
* It now supports custom ports and can properly handle chunked transfer encoding.
|
||||
* It is designed for minimal resource usage and fast performance. It does not support full HTTP features like HTTPS. Users can always use the `Command` module with `curl` to achieve similar functionality.
|
||||
* Added Umbriel wayland compositor version detection (WM, Linux)
|
||||
|
||||
Bugfixes:
|
||||
* Fixed Base64 encoding producing incorrect output for some inputs. (General)
|
||||
|
||||
@@ -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