mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Terminal (Linux): support Lxterminal version detection
This commit is contained in:
@@ -400,6 +400,14 @@ FF_MAYBE_UNUSED static bool getTerminalVersionSt(FF_MAYBE_UNUSED FFstrbuf* exe,
|
||||
return version->length > 0;
|
||||
}
|
||||
|
||||
FF_MAYBE_UNUSED static bool getTerminalVersionLxterminal(FFstrbuf* exe, FFstrbuf* version)
|
||||
{
|
||||
if(!getExeVersionRaw(exe, version)) return false;
|
||||
// lxterminal 0.3.2
|
||||
ffStrbufSubstrAfterFirstC(version, ' ');
|
||||
return version->length > 0;
|
||||
}
|
||||
|
||||
static bool getTerminalVersionContour(FFstrbuf* exe, FFstrbuf* version)
|
||||
{
|
||||
const char* env = getenv("TERMINAL_VERSION_STRING");
|
||||
@@ -410,7 +418,7 @@ static bool getTerminalVersionContour(FFstrbuf* exe, FFstrbuf* version)
|
||||
}
|
||||
if(!getExeVersionRaw(exe, version)) return false;
|
||||
// Contour Terminal Emulator 0.3.12.262
|
||||
ffStrbufSubstrAfterFirstC(version, ' ');
|
||||
ffStrbufSubstrAfterLastC(version, ' ');
|
||||
return version->length > 0;
|
||||
}
|
||||
|
||||
@@ -525,6 +533,9 @@ bool fftsGetTerminalVersion(FFstrbuf* processName, FF_MAYBE_UNUSED FFstrbuf* exe
|
||||
if(ffStrbufIgnCaseEqualS(processName, "st"))
|
||||
return getTerminalVersionSt(exe, version);
|
||||
|
||||
if(ffStrbufIgnCaseEqualS(processName, "lxterminal"))
|
||||
return getTerminalVersionLxterminal(exe, version);
|
||||
|
||||
if(ffStrbufIgnCaseEqualS(processName, "urxvt") ||
|
||||
ffStrbufIgnCaseEqualS(processName, "urxvtd") ||
|
||||
ffStrbufIgnCaseEqualS(processName, "rxvt") ||
|
||||
|
||||
Reference in New Issue
Block a user