mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Terminal (Linux): support tilix version detection
This commit is contained in:
@@ -14,6 +14,7 @@ Features:
|
||||
* Generate manual pages from `help.json` (Doc)
|
||||
* Detect marketing name of vivo smartphone (Host, Android)
|
||||
* Add txDrops detection if supported (NetIO, *BSD)
|
||||
* Support tilix version detection (Terminal, Linux)
|
||||
* Support percent type config in module level. Example:
|
||||
|
||||
```json
|
||||
|
||||
@@ -641,6 +641,26 @@ FF_MAYBE_UNUSED static bool getTerminalVersionPtyxis(FF_MAYBE_UNUSED FFstrbuf* e
|
||||
ffStrbufSubstrAfterFirstC(version, ' ');
|
||||
return true;
|
||||
}
|
||||
|
||||
FF_MAYBE_UNUSED static bool getTerminalVersionTilix(FFstrbuf* exe, FFstrbuf* version)
|
||||
{
|
||||
if(ffProcessAppendStdOut(version, (char* const[]) {
|
||||
exe->chars,
|
||||
"--version",
|
||||
NULL
|
||||
}) != NULL)
|
||||
return false;
|
||||
|
||||
uint32_t index = ffStrbufFirstIndexS(version, "Tilix version: ");
|
||||
if (index == version->length) return false;
|
||||
|
||||
index += (uint32_t) strlen("Tilix version:");
|
||||
uint32_t end = ffStrbufNextIndexC(version, index, '\n');
|
||||
|
||||
ffStrbufSubstrBefore(version, end);
|
||||
ffStrbufSubstrAfter(version, index);
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
@@ -740,6 +760,9 @@ bool fftsGetTerminalVersion(FFstrbuf* processName, FF_MAYBE_UNUSED FFstrbuf* exe
|
||||
if(ffStrbufIgnCaseEqualS(processName, "ptyxis-agent"))
|
||||
return getTerminalVersionPtyxis(exe, version);
|
||||
|
||||
if(ffStrbufIgnCaseEqualS(processName, "tilix"))
|
||||
return getTerminalVersionTilix(exe, version);
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
Reference in New Issue
Block a user