mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Terminal: support Cockpit version detection
This commit is contained in:
@@ -214,6 +214,16 @@ FF_MAYBE_UNUSED static bool getTerminalVersionMateTerminal(FFstrbuf* exe, FFstrb
|
||||
return version->length > 0;
|
||||
}
|
||||
|
||||
FF_MAYBE_UNUSED static bool getTerminalVersionCockpit(FFstrbuf* exe, FFstrbuf* version)
|
||||
{
|
||||
if(!getExeVersionRaw(exe, version)) return false;
|
||||
|
||||
//Version: 295\n...
|
||||
ffStrbufSubstrBeforeFirstC(version, '\n');
|
||||
ffStrbufSubstrAfterFirstC(version, ' ');
|
||||
return version->length > 0;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
static bool getTerminalVersionWindowsTerminal(FFstrbuf* exe, FFstrbuf* version)
|
||||
@@ -278,6 +288,9 @@ bool fftsGetTerminalVersion(FFstrbuf* processName, FF_MAYBE_UNUSED FFstrbuf* exe
|
||||
if(ffStrbufIgnCaseEqualS(processName, "mate-terminal"))
|
||||
return getTerminalVersionMateTerminal(exe, version);
|
||||
|
||||
if(ffStrbufIgnCaseEqualS(processName, "cockpit-bridge"))
|
||||
return getTerminalVersionCockpit(exe, version);
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
Reference in New Issue
Block a user