diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e052c2f3e..bc3415073 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -288,7 +288,7 @@ jobs: freebsd-amd64: name: FreeBSD-amd64 - runs-on: macos-12 + runs-on: ubuntu-latest permissions: security-events: write contents: read @@ -300,6 +300,9 @@ jobs: uses: cross-platform-actions/action@master with: operating_system: freebsd + architecture: x86-64 + cpu_count: 3 + shell: bash version: '13.2' run: | uname -a @@ -320,6 +323,43 @@ jobs: name: fastfetch-freebsd-amd64 path: ./fastfetch-*.* + freebsd-aarch64: + name: FreeBSD-aarch64 + runs-on: ubuntu-latest + permissions: + security-events: write + contents: read + steps: + - name: checkout repository + uses: actions/checkout@v4 + + - name: run VM + uses: cross-platform-actions/action@master + with: + operating_system: freebsd + architecture: arm64 + cpu_count: 3 + shell: bash + version: '13.2' + run: | + uname -a + sudo pkg update + 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 + cmake -DSET_TWEAK=Off -DBUILD_TESTS=On . + cmake --build . --target package --verbose -j4 + ./fastfetch --list-features + time ./fastfetch + time ./fastfetch --format json + time ./flashfetch + ldd fastfetch + ctest + + - name: upload artifacts + uses: actions/upload-artifact@v4 + with: + name: fastfetch-freebsd-aarch64 + path: ./fastfetch-*.* + windows-amd64: name: Windows-amd64 runs-on: windows-latest @@ -458,6 +498,7 @@ jobs: - linux-aarch64 - macos-universal - freebsd-amd64 + - freebsd-aarch64 - windows-amd64 - windows-i686 permissions: diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f24f1410..d51c7b33f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ Features: * `{ "temp": { "ndigits": 1 } }` * `{ "temp": { "color": { "green": "green", "yellow": "yellow", "red": "red" } } }` * Support specifying custom `pci.ids` path for Linux (GPU, Linux) +* Support warp-linux terminal version & terminal font detection (Terminal, Linux) # 2.8.5 diff --git a/src/common/font.c b/src/common/font.c index b2f3547b8..2e89f1c69 100644 --- a/src/common/font.c +++ b/src/common/font.c @@ -211,6 +211,7 @@ void ffFontInitValues(FFfont* font, const char* name, const char* size) ffFontInit(font); ffStrbufAppendS(&font->name, name); + ffStrbufTrim(&font->name, '"'); ffStrbufAppendS(&font->size, size); fontInitPretty(font); diff --git a/src/detection/terminalfont/terminalfont_linux.c b/src/detection/terminalfont/terminalfont_linux.c index b4bd5e36f..b843465cb 100644 --- a/src/detection/terminalfont/terminalfont_linux.c +++ b/src/detection/terminalfont/terminalfont_linux.c @@ -303,6 +303,34 @@ static void detectSt(FFTerminalFontResult* terminalFont, uint32_t pid) ffFontInitValues(&terminalFont->font, font.chars, size.chars); } +static void detectWarp(FFTerminalFontResult* terminalFont) +{ + FF_STRBUF_AUTO_DESTROY baseDir = ffStrbufCreateA(64); + + FF_LIST_FOR_EACH(FFstrbuf, dirPrefix, instance.state.platform.configDirs) + { + //We need to copy the dir each time, because it used by multiple threads, so we can't directly write to it. + ffStrbufSet(&baseDir, dirPrefix); + ffStrbufAppendS(&baseDir, "warp-terminal/user_preferences.json"); + + yyjson_doc* doc = yyjson_read_file(baseDir.chars, YYJSON_READ_INSITU | YYJSON_READ_ALLOW_TRAILING_COMMAS | YYJSON_READ_ALLOW_COMMENTS, NULL, NULL); + if (!doc) continue; + + yyjson_val* prefs = yyjson_obj_get(yyjson_doc_get_root(doc), "prefs"); + if (yyjson_is_obj(prefs)) + { + const char* fontName = yyjson_get_str(yyjson_obj_get(prefs, "FontName")); + if (!fontName) fontName = "Hack"; + const char* fontSize = yyjson_get_str(yyjson_obj_get(prefs, "FontSize")); + if (!fontSize) fontSize = "13"; + + ffFontInitValues(&terminalFont->font, fontName, fontSize); + } + yyjson_doc_free(doc); + return; + } +} + void ffDetectTerminalFontPlatform(const FFTerminalResult* terminal, FFTerminalFontResult* terminalFont) { if(ffStrbufIgnCaseEqualS(&terminal->processName, "konsole")) @@ -331,4 +359,6 @@ void ffDetectTerminalFontPlatform(const FFTerminalResult* terminal, FFTerminalFo detectXterm(terminalFont); else if(ffStrbufIgnCaseEqualS(&terminal->processName, "st")) detectSt(terminalFont, terminal->pid); + else if(ffStrbufIgnCaseEqualS(&terminal->processName, "warp")) + detectWarp(terminalFont); } diff --git a/src/detection/terminalshell/terminalshell.c b/src/detection/terminalshell/terminalshell.c index bd21025b2..9d645356a 100644 --- a/src/detection/terminalshell/terminalshell.c +++ b/src/detection/terminalshell/terminalshell.c @@ -562,7 +562,13 @@ bool fftsGetTerminalVersion(FFstrbuf* processName, FF_MAYBE_UNUSED FFstrbuf* exe { if(ffStrbufStartsWithIgnCaseS(processName, termProgram) || // processName ends with `.exe` on Windows (ffStrEquals(termProgram, "vscode") && ffStrbufStartsWithIgnCaseS(processName, "code")) || - (ffStrEquals(termProgram, "iTerm.app") && ffStrbufStartsWithIgnCaseS(processName, "iTermServer-")) + + #ifdef __APPLE__ + (ffStrEquals(termProgram, "iTerm.app") && ffStrbufStartsWithIgnCaseS(processName, "iTermServer-")) || + #elif defined(__linux__) + (ffStrEquals(termProgram, "WarpTerminal") && ffStrbufEqualS(processName, "warp")) || + #endif + false ) { ffStrbufSetS(version, termProgramVersion); return true;