Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,41 @@ jobs:
name: fastfetch-linux-aarch64
path: ./fastfetch-*.*

linux-armv7:
name: Linux-armv7
runs-on: ubuntu-22.04
permissions:
security-events: write
contents: read
steps:
- name: checkout repository
uses: actions/checkout@v4

- name: run VM
uses: uraimo/run-on-arch-action@v2
id: runcmd
with:
arch: armv7
distro: ubuntu22.04
githubToken: ${{ github.token }}
run: |
uname -a
apt-get update && apt-get install -y cmake make g++ libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev libosmesa6-dev ocl-icd-opencl-dev libnm-dev libpulse-dev libdrm-dev libddcutil-dev libchafa-dev directx-headers-dev rpm
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr .
cmake --build . --target package --verbose -j4
./fastfetch --list-features
time ./fastfetch -c presets/ci.jsonc
time ./fastfetch -c presets/ci.jsonc --format json
time ./flashfetch
ldd fastfetch
ctest

- name: upload artifacts
uses: actions/upload-artifact@v4
with:
name: fastfetch-linux-armv7
path: ./fastfetch-*.*

musl-amd64:
name: Musl-amd64
runs-on: ubuntu-latest
Expand Down Expand Up @@ -501,6 +536,7 @@ jobs:
needs:
- linux-amd64
- linux-aarch64
- linux-armv7
- musl-amd64
- musl-aarch64
- macos-universal
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
# 2.11.1

Hotfix for Android

Bugfixes:
* Fix uninitialized variables which can cause crashes (#760 #838, Battery, Android)
* Don't detect hyfetch as shell when used as a backend of hyfetch
* Fix incorrect information in man page

Features:
* Support sorcery package manager detection (Packages, Linux)
* Make `--custom-format` optional (Custom)
* Make `/` an alias of `C:\` for `--disk-folders` (Disk, Windows)

Logo:
* Fix colors of Source Mage logo


# 2.11.0

Changes:
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.12.0) # target_link_libraries with OBJECT libs & project homepage url

project(fastfetch
VERSION 2.11.0
VERSION 2.11.1
LANGUAGES C
DESCRIPTION "Fast neofetch-like system information tool"
HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch"
Expand Down
2 changes: 1 addition & 1 deletion doc/fastfetch.1.in
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ The specified configuration/preset files are searched in the following order:
When both a '.jsonc' and a '.conf' file with the same name is found,
the '.jsonc' file is preferred.

Fastfetch provides some default presets. List them with \fB \-\-print\-available\-presets\fR.
Fastfetch provides some default presets. List them with \fB\-\-list\-presets\fR.

.SH "SEE ALSO"
.BR neofetch (1)
Expand Down
10 changes: 5 additions & 5 deletions doc/json_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1117,6 +1117,9 @@
"maxItems": 2
}
}
},
"key": {
"$ref": "#/$defs/key"
}
}
},
Expand Down Expand Up @@ -1174,10 +1177,7 @@
"description": "Text to print",
"type": "string"
}
},
"required": [
"format"
]
}
},
{
"title": "Display",
Expand Down Expand Up @@ -1238,7 +1238,7 @@
},
"folders": {
"type": "string",
"description": "A colon (semicolon on Windows) separated list of folder paths for the disk output\nDefault: auto detection using mount-points"
"description": "A colon (semicolon on Windows) separated list of folder paths for the disk output\nDefault: auto detection using mount-points\nThis option overrides other `show*` options"
},
"showExternal": {
"type": "boolean",
Expand Down
2 changes: 1 addition & 1 deletion presets/examples/11.jsonc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "file:///C:/msys64/home/zhang/fastfetch/doc/json_schema.json",
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"type": "small"
},
Expand Down
85 changes: 85 additions & 0 deletions presets/examples/13.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"type": "small",
"padding": {
"top": 1
}
},
"display": {
"separator": "",
"keyWidth": 15
},
"modules": [
{
"key": "╭───────────╮",
"type": "custom"
},
{
// draw borders first to make colors of left and right border consistant
"key": "│ │\u001b[11D\u001b[31m user",
"type": "title",
"format": "{1}"
},
{
"key": "│ │\u001b[11D\u001b[32m󰇅 hname",
"type": "title",
"format": "{2}"
},
{
"key": "│ │\u001b[11D\u001b[33m󰅐 uptime",
"type": "uptime"
},
{
"key": "│ │\u001b[11D\u001b[34m󰟾 distro",
"type": "os"
},
{
"key": "│ │\u001b[11D\u001b[35m kernel",
"type": "kernel"
},
{
"key": "│ │\u001b[11D\u001b[36m󰇄 desktop",
"type": "de"
},
{
"key": "│ │\u001b[11D\u001b[31m term",
"type": "terminal"
},
{
"key": "│ │\u001b[11D\u001b[32m shell",
"type": "shell"
},
{
"key": "│ │\u001b[11D\u001b[33m󰍛 cpu",
"type": "cpu"
},
{
"key": "│ │\u001b[11D\u001b[34m󰉉 disk",
"type": "disk",
"folders": "/"
},
{
"key": "│ │\u001b[11D\u001b[35m memory",
"type": "memory"
},
{
"key": "│ │\u001b[11D\u001b[36m󰩟 network",
"type": "localip",
"format": "{1} ({4})"
},
{
"key": "├───────────┤",
"type": "custom"
},
{
"key": "│ │\u001b[11D\u001b[m colors",
"type": "colors",
"symbol": "circle"
},
{
"key": "╰───────────╯",
"type": "custom"
}
]
}
3 changes: 2 additions & 1 deletion src/data/help.json
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,8 @@
},
{
"long": "disk-folders",
"desc": "A colon (semicolon on Windows) separated list of folder paths for the disk output",
"desc": "A colon (semicolon on Windows) separated list of folder paths to be detected",
"remark": "On Windows, a drive latter must be upper cased and end with \"\\\". \"/\" is used as an alias of the system drive. This option overrides other disk-show-* options",
"arg": {
"type": "path",
"default": "Auto detection using mount-points"
Expand Down
3 changes: 3 additions & 0 deletions src/detection/battery/battery_android.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ static const char* parseTermuxApi(FFBatteryOptions* options, FFlist* results)
ffStrbufInit(&battery->modelName);
ffStrbufInit(&battery->status);
ffStrbufInit(&battery->technology);
ffStrbufInit(&battery->serial);
ffStrbufInit(&battery->manufactureDate);

battery->capacity = yyjson_get_num(yyjson_obj_get(root, "percentage"));
Expand Down Expand Up @@ -77,6 +78,8 @@ static const char* parseDumpsys(FFBatteryOptions* options, FFlist* results)
ffStrbufInit(&battery->modelName);
ffStrbufInit(&battery->status);
ffStrbufInit(&battery->technology);
ffStrbufInit(&battery->serial);
ffStrbufInit(&battery->manufactureDate);

if (ffParsePropLines(start, "AC powered: ", &temp) && ffStrbufEqualS(&temp, "true"))
ffStrbufAppendS(&battery->status, "AC powered");
Expand Down
9 changes: 8 additions & 1 deletion src/detection/disk/disk_windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include <windows.h>
#include <winioctl.h>
#include <assert.h>

const char* ffDetectDisksImpl(FFDiskOptions* options, FFlist* disks)
{
Expand All @@ -15,6 +14,14 @@ const char* ffDetectDisksImpl(FFDiskOptions* options, FFlist* disks)

FF_STRBUF_AUTO_DESTROY buffer = ffStrbufCreate();

// For cross-platform portability; used by `presets/examples/13.jsonc`
if (__builtin_expect(options->folders.length == 1 && options->folders.chars[0] == '/', 0))
{
wchar_t path[MAX_PATH + 1];
GetSystemWindowsDirectoryW(path, sizeof(path) / sizeof(*path));
ffStrbufSetF(&options->folders, "%c:\\", (char) path[0]);
}

for(uint32_t i = 0; i < length; i++)
{
wchar_t* mountpoint = buf + i;
Expand Down
2 changes: 1 addition & 1 deletion src/detection/displayserver/linux/wayland/zwlr-output.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
static void waylandZwlrTransformListener(void* data, FF_MAYBE_UNUSED struct zwlr_output_head_v1 *zwlr_output_head_v1, int32_t transform)
{
WaylandDisplay* wldata = (WaylandDisplay*) data;
wldata->transform = transform;
wldata->transform = (enum wl_output_transform) transform;
}

static void waylandZwlrScaleListener(void* data, FF_MAYBE_UNUSED struct zwlr_output_head_v1 *zwlr_output_head_v1, wl_fixed_t scale)
Expand Down
1 change: 1 addition & 0 deletions src/detection/packages/packages.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ typedef struct FFPackagesResult
uint32_t rpm;
uint32_t scoop;
uint32_t snap;
uint32_t sorcery;
uint32_t winget;
uint32_t xbps;

Expand Down
1 change: 1 addition & 0 deletions src/detection/packages/packages_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ static void getPackageCounts(FFstrbuf* baseDir, FFPackagesResult* packageCounts,
if (!(options->disabled & FF_PACKAGES_FLAG_PALUDIS_BIT)) packageCounts->paludis += countFilesRecursive(baseDir, "/var/db/paludis/repositories", "environment.bz2");
if (!(options->disabled & FF_PACKAGES_FLAG_OPKG_BIT)) packageCounts->opkg += getNumStrings(baseDir, "/usr/lib/opkg/status", "Package:"); // openwrt
if (!(options->disabled & FF_PACKAGES_FLAG_AM_BIT)) packageCounts->am = getAM(baseDir);
if (!(options->disabled & FF_PACKAGES_FLAG_SORCERY_BIT)) packageCounts->sorcery += getNumStrings(baseDir, "/var/state/sorcery/packages", ":installed:");
}

static void getPackageCountsRegular(FFstrbuf* baseDir, FFPackagesResult* packageCounts, FFPackagesOptions* options)
Expand Down
1 change: 1 addition & 0 deletions src/detection/terminalshell/terminalshell_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ static pid_t getShellInfo(FFShellResult* result, pid_t pid)
ffStrEquals(name, "perf") ||
ffStrEquals(name, "guake-wrapped") ||
ffStrEquals(name, "time") ||
ffStrEquals(name, "hyfetch") || //when hyfetch uses fastfetch as backend
ffStrContainsIgnCase(name, "debug") ||
ffStrContainsIgnCase(name, "not-found") ||
ffStrEndsWith(name, ".sh")
Expand Down
1 change: 1 addition & 0 deletions src/detection/terminalshell/terminalshell_windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ static uint32_t getShellInfo(FFShellResult* result, uint32_t pid)
ffStrbufIgnCaseEqualS(&result->prettyName, "python") || // python on windows generates shim executables
ffStrbufIgnCaseEqualS(&result->prettyName, "fastfetch") || // scoop warps the real binaries with a "shim" exe
ffStrbufIgnCaseEqualS(&result->prettyName, "flashfetch") ||
ffStrbufIgnCaseEqualS(&result->prettyName, "hyfetch") || // uses fastfetch as backend
ffStrbufContainIgnCaseS(&result->prettyName, "debug") ||
ffStrbufContainIgnCaseS(&result->prettyName, "time") ||
ffStrbufStartsWithIgnCaseS(&result->prettyName, "ConEmu") // https://github.com/fastfetch-cli/fastfetch/issues/488#issuecomment-1619982014
Expand Down
6 changes: 3 additions & 3 deletions src/logo/builtin.c
Original file line number Diff line number Diff line change
Expand Up @@ -3791,14 +3791,14 @@ static const FFlogo S[] = {
FF_COLOR_FG_WHITE,
},
},
// SourceMage
// Source Mage
{
.names = {"Source Mage", "source_mage"},
.names = {"Source Mage", "Source Mage GNU/Linux", "source_mage", "sourcemage"},
.lines = FASTFETCH_DATATEXT_LOGO_SOURCE_MAGE,
.colors = {
FF_COLOR_FG_WHITE,
},
.colorKeys = FF_COLOR_FG_BLUE,
.colorKeys = FF_COLOR_FG_RED,
.colorTitle = FF_COLOR_FG_WHITE,
},
// Solaris
Expand Down
6 changes: 0 additions & 6 deletions src/modules/custom/custom.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@

void ffPrintCustom(FFCustomOptions* options)
{
if (options->moduleArgs.outputFormat.length == 0)
{
ffPrintError(FF_CUSTOM_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, "output format must be set for custom module");
return;
}

ffPrintLogoAndKey(FF_CUSTOM_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT);
ffStrbufWriteTo(&options->moduleArgs.outputFormat, stdout);
puts(FASTFETCH_TEXT_MODIFIER_RESET);
Expand Down
1 change: 1 addition & 0 deletions src/modules/packages/option.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ typedef enum FFPackagesFlags
FF_PACKAGES_FLAG_WINGET_BIT = 1 << 17,
FF_PACKAGES_FLAG_XBPS_BIT = 1 << 18,
FF_PACKAGES_FLAG_AM_BIT = 1 << 19,
FF_PACKAGES_FLAG_SORCERY_BIT = 1 << 20,
} FFPackagesFlags;

typedef struct FFPackagesOptions
Expand Down
Loading