Skip to content

Commit c935527

Browse files
authored
Merge pull request #740 from fastfetch-cli/dev
Release: v2.8.6
2 parents de2cd79 + 0491594 commit c935527

File tree

5 files changed

+81
-2
lines changed

5 files changed

+81
-2
lines changed

.github/workflows/ci.yml

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ jobs:
288288

289289
freebsd-amd64:
290290
name: FreeBSD-amd64
291-
runs-on: macos-12
291+
runs-on: ubuntu-latest
292292
permissions:
293293
security-events: write
294294
contents: read
@@ -300,6 +300,9 @@ jobs:
300300
uses: cross-platform-actions/action@master
301301
with:
302302
operating_system: freebsd
303+
architecture: x86-64
304+
cpu_count: 3
305+
shell: bash
303306
version: '13.2'
304307
run: |
305308
uname -a
@@ -320,6 +323,43 @@ jobs:
320323
name: fastfetch-freebsd-amd64
321324
path: ./fastfetch-*.*
322325

326+
freebsd-aarch64:
327+
name: FreeBSD-aarch64
328+
runs-on: ubuntu-latest
329+
permissions:
330+
security-events: write
331+
contents: read
332+
steps:
333+
- name: checkout repository
334+
uses: actions/checkout@v4
335+
336+
- name: run VM
337+
uses: cross-platform-actions/action@master
338+
with:
339+
operating_system: freebsd
340+
architecture: arm64
341+
cpu_count: 3
342+
shell: bash
343+
version: '13.2'
344+
run: |
345+
uname -a
346+
sudo pkg update
347+
sudo pkg install -y cmake git pkgconf binutils wayland vulkan-headers vulkan-loader libxcb libXrandr libX11 libdrm glib dconf dbus sqlite3-tcl xfce4-conf ImageMagick6 ImageMagick7 chafa egl libosmesa opencl ocl-icd v4l_compat
348+
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On .
349+
cmake --build . --target package --verbose -j4
350+
./fastfetch --list-features
351+
time ./fastfetch
352+
time ./fastfetch --format json
353+
time ./flashfetch
354+
ldd fastfetch
355+
ctest
356+
357+
- name: upload artifacts
358+
uses: actions/upload-artifact@v4
359+
with:
360+
name: fastfetch-freebsd-aarch64
361+
path: ./fastfetch-*.*
362+
323363
windows-amd64:
324364
name: Windows-amd64
325365
runs-on: windows-latest
@@ -458,6 +498,7 @@ jobs:
458498
- linux-aarch64
459499
- macos-universal
460500
- freebsd-amd64
501+
- freebsd-aarch64
461502
- windows-amd64
462503
- windows-i686
463504
permissions:

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Features:
1111
* `{ "temp": { "ndigits": 1 } }`
1212
* `{ "temp": { "color": { "green": "green", "yellow": "yellow", "red": "red" } } }`
1313
* Support specifying custom `pci.ids` path for Linux (GPU, Linux)
14+
* Support warp-linux terminal version & terminal font detection (Terminal, Linux)
1415

1516
# 2.8.5
1617

src/common/font.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ void ffFontInitValues(FFfont* font, const char* name, const char* size)
211211
ffFontInit(font);
212212

213213
ffStrbufAppendS(&font->name, name);
214+
ffStrbufTrim(&font->name, '"');
214215
ffStrbufAppendS(&font->size, size);
215216

216217
fontInitPretty(font);

src/detection/terminalfont/terminalfont_linux.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,34 @@ static void detectSt(FFTerminalFontResult* terminalFont, uint32_t pid)
303303
ffFontInitValues(&terminalFont->font, font.chars, size.chars);
304304
}
305305

306+
static void detectWarp(FFTerminalFontResult* terminalFont)
307+
{
308+
FF_STRBUF_AUTO_DESTROY baseDir = ffStrbufCreateA(64);
309+
310+
FF_LIST_FOR_EACH(FFstrbuf, dirPrefix, instance.state.platform.configDirs)
311+
{
312+
//We need to copy the dir each time, because it used by multiple threads, so we can't directly write to it.
313+
ffStrbufSet(&baseDir, dirPrefix);
314+
ffStrbufAppendS(&baseDir, "warp-terminal/user_preferences.json");
315+
316+
yyjson_doc* doc = yyjson_read_file(baseDir.chars, YYJSON_READ_INSITU | YYJSON_READ_ALLOW_TRAILING_COMMAS | YYJSON_READ_ALLOW_COMMENTS, NULL, NULL);
317+
if (!doc) continue;
318+
319+
yyjson_val* prefs = yyjson_obj_get(yyjson_doc_get_root(doc), "prefs");
320+
if (yyjson_is_obj(prefs))
321+
{
322+
const char* fontName = yyjson_get_str(yyjson_obj_get(prefs, "FontName"));
323+
if (!fontName) fontName = "Hack";
324+
const char* fontSize = yyjson_get_str(yyjson_obj_get(prefs, "FontSize"));
325+
if (!fontSize) fontSize = "13";
326+
327+
ffFontInitValues(&terminalFont->font, fontName, fontSize);
328+
}
329+
yyjson_doc_free(doc);
330+
return;
331+
}
332+
}
333+
306334
void ffDetectTerminalFontPlatform(const FFTerminalResult* terminal, FFTerminalFontResult* terminalFont)
307335
{
308336
if(ffStrbufIgnCaseEqualS(&terminal->processName, "konsole"))
@@ -331,4 +359,6 @@ void ffDetectTerminalFontPlatform(const FFTerminalResult* terminal, FFTerminalFo
331359
detectXterm(terminalFont);
332360
else if(ffStrbufIgnCaseEqualS(&terminal->processName, "st"))
333361
detectSt(terminalFont, terminal->pid);
362+
else if(ffStrbufIgnCaseEqualS(&terminal->processName, "warp"))
363+
detectWarp(terminalFont);
334364
}

src/detection/terminalshell/terminalshell.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,13 @@ bool fftsGetTerminalVersion(FFstrbuf* processName, FF_MAYBE_UNUSED FFstrbuf* exe
562562
{
563563
if(ffStrbufStartsWithIgnCaseS(processName, termProgram) || // processName ends with `.exe` on Windows
564564
(ffStrEquals(termProgram, "vscode") && ffStrbufStartsWithIgnCaseS(processName, "code")) ||
565-
(ffStrEquals(termProgram, "iTerm.app") && ffStrbufStartsWithIgnCaseS(processName, "iTermServer-"))
565+
566+
#ifdef __APPLE__
567+
(ffStrEquals(termProgram, "iTerm.app") && ffStrbufStartsWithIgnCaseS(processName, "iTermServer-")) ||
568+
#elif defined(__linux__)
569+
(ffStrEquals(termProgram, "WarpTerminal") && ffStrbufEqualS(processName, "warp")) ||
570+
#endif
571+
false
566572
) {
567573
ffStrbufSetS(version, termProgramVersion);
568574
return true;

0 commit comments

Comments
 (0)