mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-31 01:56:28 +01:00
Terminal (Linux): support tilix version detection
This commit is contained in:
@@ -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