Skip to content

Commit

Permalink
Terminal: Support sakura version & font detection
Browse files Browse the repository at this point in the history
Fix #1424
  • Loading branch information
CarterLi committed Dec 2, 2024
1 parent dfe36da commit ab200d7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Features:
* Detect current Wi-Fi channel and maximum frequency (Wifi)
* Report processor package count (#1413, CPU)
* Remove duplicate whitespaces in CPU name
* Support sakura terminal version & font detection (Terminal / TerminalFont, Linux)

Logo:
* Fix LMDE
Expand Down
2 changes: 2 additions & 0 deletions src/detection/terminalfont/terminalfont_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,4 +454,6 @@ void ffDetectTerminalFontPlatform(const FFTerminalResult* terminal, FFTerminalFo
detectWestonTerminal(terminalFont);
else if(ffStrbufStartsWithIgnCaseS(&terminal->processName, "terminator"))
detectTerminator(terminalFont);
else if(ffStrbufStartsWithIgnCaseS(&terminal->processName, "sakura"))
detectFromConfigFile("sakura/sakura.conf", "font=", terminalFont);;
}
16 changes: 16 additions & 0 deletions src/detection/terminalshell/terminalshell.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,19 @@ FF_MAYBE_UNUSED static bool getTerminalVersionTilix(FFstrbuf* exe, FFstrbuf* ver
ffStrbufSubstrAfter(version, index);
return true;
}

FF_MAYBE_UNUSED static bool getTerminalVersionSakura(FFstrbuf* exe, FFstrbuf* version)
{
if(ffProcessAppendStdErr(version, (char* const[]) {
exe->chars,
"--version",
NULL
}) != NULL) // sakura version is 3.8.8
return false;

ffStrbufSubstrAfterLastC(version, ' ');
return true;
}
#endif

#ifdef _WIN32
Expand Down Expand Up @@ -763,6 +776,9 @@ bool fftsGetTerminalVersion(FFstrbuf* processName, FF_MAYBE_UNUSED FFstrbuf* exe
if(ffStrbufIgnCaseEqualS(processName, "tilix"))
return getTerminalVersionTilix(exe, version);

if(ffStrbufIgnCaseEqualS(processName, "sakura"))
return getTerminalVersionSakura(exe, version);

#endif

#ifdef _WIN32
Expand Down

0 comments on commit ab200d7

Please sign in to comment.