Skip to content

Commit ab200d7

Browse files
committed
Terminal: Support sakura version & font detection
Fix #1424
1 parent dfe36da commit ab200d7

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Features:
2121
* Detect current Wi-Fi channel and maximum frequency (Wifi)
2222
* Report processor package count (#1413, CPU)
2323
* Remove duplicate whitespaces in CPU name
24+
* Support sakura terminal version & font detection (Terminal / TerminalFont, Linux)
2425

2526
Logo:
2627
* Fix LMDE

src/detection/terminalfont/terminalfont_linux.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,4 +454,6 @@ void ffDetectTerminalFontPlatform(const FFTerminalResult* terminal, FFTerminalFo
454454
detectWestonTerminal(terminalFont);
455455
else if(ffStrbufStartsWithIgnCaseS(&terminal->processName, "terminator"))
456456
detectTerminator(terminalFont);
457+
else if(ffStrbufStartsWithIgnCaseS(&terminal->processName, "sakura"))
458+
detectFromConfigFile("sakura/sakura.conf", "font=", terminalFont);;
457459
}

src/detection/terminalshell/terminalshell.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,19 @@ FF_MAYBE_UNUSED static bool getTerminalVersionTilix(FFstrbuf* exe, FFstrbuf* ver
661661
ffStrbufSubstrAfter(version, index);
662662
return true;
663663
}
664+
665+
FF_MAYBE_UNUSED static bool getTerminalVersionSakura(FFstrbuf* exe, FFstrbuf* version)
666+
{
667+
if(ffProcessAppendStdErr(version, (char* const[]) {
668+
exe->chars,
669+
"--version",
670+
NULL
671+
}) != NULL) // sakura version is 3.8.8
672+
return false;
673+
674+
ffStrbufSubstrAfterLastC(version, ' ');
675+
return true;
676+
}
664677
#endif
665678

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

779+
if(ffStrbufIgnCaseEqualS(processName, "sakura"))
780+
return getTerminalVersionSakura(exe, version);
781+
766782
#endif
767783

768784
#ifdef _WIN32

0 commit comments

Comments
 (0)