Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
e953ed9
Packaging: update debian stuff [ci skip]
CarterLi Nov 18, 2024
4651704
mtgpu: header file cleanup for forward compatibility (#1405)
yeahdongcn Nov 19, 2024
16b7a4a
Media (Linux): improve performance of dbus communication
CarterLi Nov 19, 2024
fdc9bee
DBus: use `general.processingTimeout` as its timeout instead hard coding
CarterLi Nov 19, 2024
4cbcd0f
Wifi (Linux): improve performance
CarterLi Nov 20, 2024
3d5133e
DisplayServer (Linux): remove support of xcb & xlib
CarterLi Nov 20, 2024
fa92900
Display (Linux): detect preferred resolution and refresh rate
CarterLi Nov 20, 2024
21a3576
Display (macOS): detect maximum resolution & refresh rate
CarterLi Nov 20, 2024
4cca63a
Display (Windows): detect preferred resolution & refresh rate
CarterLi Nov 20, 2024
7948e62
Display (Android): fix build
CarterLi Nov 20, 2024
925c347
Display: add scale factor in custom format
CarterLi Nov 20, 2024
cee880c
Display: print preferred resolution & refresh rate in custom format
CarterLi Nov 20, 2024
8b62ad7
Display (FreeBSD): fix build
CarterLi Nov 20, 2024
a567268
Display (Linux): fix preferred resolution detection for wayland
CarterLi Nov 20, 2024
71b073e
CMake: fix possible linking errors in `BINARY_LINK_TYPE=dynamic` mode
CarterLi Nov 20, 2024
9a1d185
Display: don't report screen size when display is mirrored
CarterLi Nov 21, 2024
d48c76b
Wifi: detect channel and frequency
CarterLi Nov 21, 2024
601b970
Display: report ppi to 0 if screen size is not available
CarterLi Nov 21, 2024
06055cc
Wifi (macOS): fix build on old OS version
CarterLi Nov 21, 2024
7000317
Wifi (Linux): detect frequency & channel number
CarterLi Nov 22, 2024
94f8ff9
Wifi: print channel band
CarterLi Nov 22, 2024
2197cfb
Wifi (Android): report more props
CarterLi Nov 22, 2024
864fb91
Chore: silence some warnings
CarterLi Nov 22, 2024
c0be263
Wifi (Android): silence compiler warnings
CarterLi Nov 22, 2024
55352be
Wifi (FreeBSD): support channel & frequency detection
CarterLi Nov 23, 2024
1b83554
Users: fix invalid var name
CarterLi Nov 23, 2024
64287ee
Display: change physical size detection to use basic display parameters
CarterLi Nov 23, 2024
3463fc3
Scripts: use datetime to get date and set timezone to UTC (#1410)
charles2910 Nov 24, 2024
e77c311
OS (Linux): check for lmde
CarterLi Nov 25, 2024
04088b5
Logo (Builtin): update MidOS
CarterLi Nov 25, 2024
0cd7aea
Display (macOS): don't crash with NULL pointer references
CarterLi Nov 25, 2024
b76eb87
CI: fix building on macOS
CarterLi Nov 25, 2024
7535ce8
Support for dual CPU systems (#1417)
AzimovParviz Nov 26, 2024
8b41cbd
CPU (Linux): refactor; fix cpu count detection
CarterLi Nov 26, 2024
9955e9d
CPU: remove duplicate whitespaces in CPU name
CarterLi Nov 26, 2024
ee564de
CPU: change `cpuCount` to `packages`; support custom format
CarterLi Nov 26, 2024
69a7e64
CPU (Linux): support up to 128-socket boards
CarterLi Nov 26, 2024
90bbefe
CPU (Windows): code cleanup
CarterLi Nov 26, 2024
77c0619
GPU (Linux): detect GPU NV type
CarterLi Nov 28, 2024
bbe2396
Logo (Builtin): add Windows Server 2025
CarterLi Nov 28, 2024
ee8801b
WM (Linux): fix wl-restart parsing (#1422)
ErrorNoInternet Nov 29, 2024
3004ce8
Completion (Zsh): fix syntax error in completion file (#1421)
Kemboiray Nov 29, 2024
692ad50
Wifi (Windows): make unit of bitrates be consistant
CarterLi Nov 30, 2024
f073f48
Wifi (Linux): detect Wifi-7
CarterLi Dec 1, 2024
e9ab67b
Processing (Linux): interrupt poll & read syscalls when the child pro…
CarterLi Dec 2, 2024
dfe36da
Release: v2.31.0
CarterLi Dec 2, 2024
ab200d7
Terminal: Support sakura version & font detection
CarterLi Dec 2, 2024
6edf763
Display (Linux): detect bit depth when libdrm is used
CarterLi Dec 3, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ jobs:

macos-universal:
name: macOS-universal
runs-on: macos-12
runs-on: macos-latest
permissions:
security-events: write
contents: read
Expand Down
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
# 2.31.0

Bugfixes:
* Improve performance of media detection; fix musikcube detection (Media, Linux)
* After the change, `general.processingTimeout` will also control the timeout of dbus remote calls
* Fix invalid variable names (#1408, Users)
* Change physical size detection to use basic display parameters (#1406)
* Fix possible sigfaults when detecting displays (#1393)
* Fix Nvidia card type detection
* Fix wl-restart parsing (#1422, WM, Linux)
* Fix syntax error in completion file (#1421)
* Fix hunging when using `ssh-agent` as command text (#1418, Command, macOS)

Features:
* Remove support of xcb & xlib and xrandr extension is always required (Display)
* Support preferred resolution & refresh rate detection
* On macOS there is no preferred resolution reported and maximum available resolution is reported instead.
* `--display-format {preferred-width}x{preferred-height}@{preferred-refresh-rate}`
* Report scale factor in custom format (Display)
* `--display-format {scale-factor}`
* 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
* Update MidOS
* Add Windows Server 2025

# 2.30.1

Bugfixes:
Expand Down
15 changes: 4 additions & 11 deletions 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.30.1
VERSION 2.31.0
LANGUAGES C
DESCRIPTION "Fast neofetch-like system information tool"
HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch"
Expand Down Expand Up @@ -57,9 +57,7 @@ include(CMakeDependentOption)
cmake_dependent_option(ENABLE_VULKAN "Enable vulkan" ON "LINUX OR APPLE OR FreeBSD OR OpenBSD OR NetBSD OR WIN32 OR ANDROID OR SunOS" OFF)
cmake_dependent_option(ENABLE_WAYLAND "Enable wayland-client" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD" OFF)
cmake_dependent_option(ENABLE_XCB_RANDR "Enable xcb-randr" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR SunOS" OFF)
cmake_dependent_option(ENABLE_XCB "Enable xcb" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR SunOS" OFF)
cmake_dependent_option(ENABLE_XRANDR "Enable xrandr" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR SunOS" OFF)
cmake_dependent_option(ENABLE_X11 "Enable x11" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR SunOS" OFF)
cmake_dependent_option(ENABLE_DRM "Enable libdrm" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR SunOS" OFF)
cmake_dependent_option(ENABLE_DRM_AMDGPU "Enable libdrm_amdgpu" ON "LINUX" OFF)
cmake_dependent_option(ENABLE_GIO "Enable gio-2.0" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR SunOS" OFF)
Expand Down Expand Up @@ -1222,6 +1220,9 @@ endif()
if(NOT BINARY_LINK_TYPE STREQUAL "dlopen")
message(STATUS "Enabling custom link type: ${BINARY_LINK_TYPE}")
target_compile_definitions(libfastfetch PRIVATE FF_DISABLE_DLOPEN=1)
if(NOT WIN32)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--copy-dt-needed-entries")
endif()
endif()

function(ff_lib_enable VARNAME PKGCONFIG_NAMES CMAKE_NAME)
Expand Down Expand Up @@ -1277,18 +1278,10 @@ ff_lib_enable(XCB_RANDR
"xcb-randr"
"XcbRandr"
)
ff_lib_enable(XCB
"xcb"
"Xcb"
)
ff_lib_enable(XRANDR
"xrandr"
"XRandr"
)
ff_lib_enable(X11
"x11"
"X11"
)
ff_lib_enable(DRM
"libdrm"
"Libdrm"
Expand Down
6 changes: 3 additions & 3 deletions completions/fastfetch.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ def main():
for flag in data[key]:
if flag["long"] == "logo-color-[1-9]":
for i in range(1, 10):
command_prefix = f"--logo-color-{i}[{flag["desc"]} ({i})]"
command_prefix = f"--logo-color-{i}[{flag['desc']} ({i})]"
print_command(command_prefix, flag)
continue

if flag.get("pseudo", False):
continue

if "short" in flag:
command_prefix = f"-{flag["short"]}[{flag["desc"]}]"
command_prefix = f"-{flag['short']}[{flag['desc']}]"
print_command(command_prefix, flag)

if "long" in flag:
command_prefix = f"--{flag["long"]}[{flag["desc"]}]"
command_prefix = f"--{flag['long']}[{flag['desc']}]"
print_command(command_prefix, flag)


Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
fastfetch (2.30.1) jammy; urgency=medium

* Update to 2.30.1

-- Carter Li <[email protected]> Mon, 18 Nov 2024 15:40:48 +0800

fastfetch (2.30.0) jammy; urgency=medium

* Update to 2.30.0
Expand Down
2 changes: 1 addition & 1 deletion debian/files
Original file line number Diff line number Diff line change
@@ -1 +1 @@
fastfetch_2.30.0_source.buildinfo universe/utils optional
fastfetch_2.30.1_source.buildinfo universe/utils optional
4 changes: 2 additions & 2 deletions presets/ci.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@
"opengl",
"opencl",
"users",
"bluetooth",
"bluetoothradio",
// "bluetooth", // doesn't work on macOS because it requires bluetooth permissions
// "bluetoothradio",
"sound",
"camera",
"gamepad",
Expand Down
8 changes: 5 additions & 3 deletions scripts/gen-man.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"""

from json import load
from datetime import date
from datetime import datetime, timezone
from time import time
from re import search
from os import environ, path
Expand All @@ -36,8 +36,10 @@
titlePage = "Fastfetch man page"
# date (center footer)
# format : "Month (abbreviation) Day Year"
todayDate = date.fromtimestamp(
int(environ.get("SOURCE_DATE_EPOCH", time()))).strftime("%b %d %Y")
todayDate = datetime.fromtimestamp(
int(environ.get("SOURCE_DATE_EPOCH", time())),
tz=timezone.utc,
).strftime("%b %d %Y")
# file to fastfetch version (left footer)
pathToVersionFile = path.join(pathToCurrentDir, "../CMakeLists.txt")

Expand Down
4 changes: 2 additions & 2 deletions src/common/dbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ DBusMessage* ffDBusGetMethodReply(FFDBusData* dbus, const char* busName, const c
if (arg)
dbus->lib->ffdbus_message_append_args(message, DBUS_TYPE_STRING, &arg, DBUS_TYPE_INVALID);

DBusMessage* reply = dbus->lib->ffdbus_connection_send_with_reply_and_block(dbus->connection, message, FF_DBUS_TIMEOUT_MILLISECONDS, NULL);
DBusMessage* reply = dbus->lib->ffdbus_connection_send_with_reply_and_block(dbus->connection, message, instance.config.general.processingTimeout, NULL);

dbus->lib->ffdbus_message_unref(message);

Expand All @@ -189,7 +189,7 @@ DBusMessage* ffDBusGetProperty(FFDBusData* dbus, const char* busName, const char
DBUS_TYPE_STRING, &property,
DBUS_TYPE_INVALID);

DBusMessage* reply = dbus->lib->ffdbus_connection_send_with_reply_and_block(dbus->connection, message, FF_DBUS_TIMEOUT_MILLISECONDS, NULL);
DBusMessage* reply = dbus->lib->ffdbus_connection_send_with_reply_and_block(dbus->connection, message, instance.config.general.processingTimeout, NULL);

dbus->lib->ffdbus_message_unref(message);

Expand Down
7 changes: 5 additions & 2 deletions src/common/dbus.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#include "util/FFstrbuf.h"
#include "common/library.h"

#define FF_DBUS_TIMEOUT_MILLISECONDS 100

typedef struct FFDBusLibrary
{
FF_LIBRARY_SYMBOL(dbus_bus_get)
Expand Down Expand Up @@ -38,4 +36,9 @@ DBusMessage* ffDBusGetProperty(FFDBusData* dbus, const char* busName, const char
bool ffDBusGetPropertyString(FFDBusData* dbus, const char* busName, const char* objectPath, const char* interface, const char* property, FFstrbuf* result);
bool ffDBusGetPropertyUint(FFDBusData* dbus, const char* busName, const char* objectPath, const char* interface, const char* property, uint32_t* result);

static inline DBusMessage* ffDBusGetAllProperties(FFDBusData* dbus, const char* busName, const char* objectPath, const char* interface)
{
return ffDBusGetMethodReply(dbus, busName, objectPath, "org.freedesktop.DBus.Properties", "GetAll", interface);
}

#endif // FF_HAVE_DBUS
17 changes: 7 additions & 10 deletions src/common/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,21 @@ static void resetConsole(void)
}

#ifdef _WIN32
BOOL WINAPI consoleHandler(DWORD signal)
BOOL WINAPI consoleHandler(FF_MAYBE_UNUSED DWORD signal)
{
FF_UNUSED(signal);
resetConsole();
exit(0);
}
#else
static void exitSignalHandler(int signal)
static void exitSignalHandler(FF_MAYBE_UNUSED int signal)
{
FF_UNUSED(signal);
resetConsole();
exit(0);
}
static void chldSignalHandler(FF_MAYBE_UNUSED int signal)
{
// empty; used to interrupt the poll and read syscalls
}
#endif

void ffStart(void)
Expand Down Expand Up @@ -118,6 +120,7 @@ void ffStart(void)
sigaction(SIGINT, &action, NULL);
sigaction(SIGTERM, &action, NULL);
sigaction(SIGQUIT, &action, NULL);
sigaction(SIGCHLD, &(struct sigaction) { .sa_handler = chldSignalHandler }, NULL);
#endif

//reset everything to default before we start printing
Expand Down Expand Up @@ -179,15 +182,9 @@ void ffListFeatures(void)
#if FF_HAVE_XCB_RANDR
"xcb-randr\n"
#endif
#if FF_HAVE_XCB
"xcb\n"
#endif
#if FF_HAVE_XRANDR
"xrandr\n"
#endif
#if FF_HAVE_X11
"x11\n"
#endif
#if FF_HAVE_DRM
"drm\n"
#endif
Expand Down
22 changes: 18 additions & 4 deletions src/common/processing_linux.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "fastfetch.h"
#include "common/processing.h"
#include "common/io/io.h"
#include "common/time.h"
#include "util/stringUtils.h"
#include "util/mallocHelper.h"

Expand Down Expand Up @@ -90,6 +89,16 @@ const char* ffProcessAppendOutput(FFstrbuf* buffer, char* const argv[], bool use
waitpid(childPid, NULL, 0);
return "poll(&pollfd, 1, timeout) timeout (try increasing --processing-timeout)";
}
else if (errno == EINTR)
{
// The child process has been terminated. See `chldSignalHandler` in `common/init.c`
if (waitpid(childPid, NULL, WNOHANG) == childPid)
{
// Read remaining data from the pipe
fcntl(childPipeFd, F_SETFL, O_CLOEXEC | O_NONBLOCK);
childPid = -1;
}
}
else if (pollfd.revents & POLLERR)
{
kill(childPid, SIGTERM);
Expand All @@ -104,7 +113,7 @@ const char* ffProcessAppendOutput(FFstrbuf* buffer, char* const argv[], bool use
else if (nRead == 0)
{
int stat_loc = 0;
if (waitpid(childPid, &stat_loc, 0) == childPid)
if (childPid > 0 && waitpid(childPid, &stat_loc, 0) == childPid)
{
if (!WIFEXITED(stat_loc))
return "child process exited abnormally";
Expand All @@ -113,10 +122,15 @@ const char* ffProcessAppendOutput(FFstrbuf* buffer, char* const argv[], bool use
// We only handle 127 as an error. See `getTerminalVersionUrxvt` in `terminalshell.c`
return NULL;
}
return "waitpid() failed";
return NULL;
}
else if (nRead < 0)
break;
{
if (errno == EAGAIN)
return NULL;
else
break;
}
};

return "read(childPipeFd, str, FF_PIPE_BUFSIZ) failed";
Expand Down
2 changes: 1 addition & 1 deletion src/detection/brightness/brightness_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ double ddca_set_default_sleep_multiplier(double multiplier); // ddcutil 1.4
DDCA_Status ddca_init(const char *libopts, int syslog_level, int opts);
#endif

static const char* detectWithDdcci(FFBrightnessOptions* options, FFlist* result)
static const char* detectWithDdcci(FF_MAYBE_UNUSED FFBrightnessOptions* options, FFlist* result)
{
FF_LIBRARY_LOAD(libddcutil, "dlopen ddcutil failed", "libddcutil" FF_LIBRARY_EXTENSION, 5);
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libddcutil, ddca_get_display_info_list2)
Expand Down
1 change: 1 addition & 0 deletions src/detection/cpu/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const char* ffDetectCPU(const FFCPUOptions* options, FFCPUResult* cpu)
ffStrbufRemoveStrings(&cpu->name, ARRAY_SIZE(removeStrings), removeStrings);
ffStrbufSubstrBeforeFirstC(&cpu->name, '@'); //Cut the speed output in the name as we append our own
ffStrbufTrimRight(&cpu->name, ' '); //If we removed the @ in previous step there was most likely a space before it
ffStrbufRemoveDupWhitespaces(&cpu->name);
return NULL;
}

Expand Down
1 change: 1 addition & 0 deletions src/detection/cpu/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ typedef struct FFCPUResult
FFstrbuf name;
FFstrbuf vendor;

uint16_t packages;
uint16_t coresPhysical;
uint16_t coresLogical;
uint16_t coresOnline;
Expand Down
1 change: 1 addition & 0 deletions src/detection/cpu/cpu_apple.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ const char* ffDetectCPUImpl(const FFCPUOptions* options, FFCPUResult* cpu)
return "sysctlbyname(machdep.cpu.brand_string) failed";

ffSysctlGetString("machdep.cpu.vendor", &cpu->vendor);
cpu->packages = (uint16_t) ffSysctlGetInt("hw.packages", 1);
if (cpu->vendor.length == 0 && ffStrbufStartsWithS(&cpu->name, "Apple "))
ffStrbufAppendS(&cpu->vendor, "Apple");

Expand Down
Loading
Loading