Skip to content

Commit a4b9784

Browse files
authored
Merge pull request #823 from fastfetch-cli/dev
Release v2.11.0
2 parents f3417b1 + 3fe2d80 commit a4b9784

File tree

15 files changed

+115
-103
lines changed

15 files changed

+115
-103
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ strace /path/to/fastfetch --multithreading false -s {MODULE} --pipe
5959

6060
If you cannot do the instructions above, please upload the core dump file:
6161

62+
## If fastfetch is slow
63+
64+
Use `time fastfetch --stat` to show time usage for each module.
65+
6266
## If my image logo didn't show / work
6367

6468
<!-- Please make sure the terminal does support the image protocol you used. Note Gnome terminal doesn't support any image protocols -->

CHANGELOG.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 2.10.3
1+
# 2.11.0
22

33
Changes:
44
* Default `hideCursor` to false. It doesn't make much difference but makes user's terminal unusable if fastfetch is not exited correctly.
@@ -10,14 +10,21 @@ Bugfixes:
1010
* Fix wifi detection on platforms that don't use NetworkManager (#811, Wifi, Linux)
1111
* Fix NixOS wrapped process name (#814, Terminal, Linux)
1212
* Fix GPU type detection for AMD cards (#816, GPU, Linux)
13+
* Silence system deprecation warnings (#822, Camera, macOS)
1314

1415
Features:
1516
* Add basic support DE detection support for UKUI (DE, Linux)
1617
* Support printing total number of nix / flatpak / brew packages (Packages)
1718
* See `fastfetch -h packages-format` for detail
1819
* Better max CPU frequency detection support with `CPUID / 16H` instruction (CPU, Windows)
19-
* This requires Core I Gen 6 or newer, and with `Virtual Machine Platform` Windows feature disabled. X86 only.
20+
* This requires Intel Core I Gen 6 or newer, and with `Virtual Machine Platform` Windows feature disabled. X86 only.
2021
* Improve performance of nix packages detection (Packages, Linux)
22+
* Make config specified in JSONC overridable by command line flags
23+
* Note this change only make global config overridable; module configs are still not
24+
* Suggest increasing `--processing-timeout` when child process timeouts
25+
* Only detect folders that specified by `--disk-folders`
26+
* Previously `--disk-folders` only omits unmatched disks from output
27+
* This option can be used to improve detection performance by ignoring slow network drives
2128

2229
# 2.10.2
2330

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.12.0) # target_link_libraries with OBJECT libs & project homepage url
22

33
project(fastfetch
4-
VERSION 2.10.3
4+
VERSION 2.11.0
55
LANGUAGES C
66
DESCRIPTION "Fast neofetch-like system information tool"
77
HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch"

src/common/processing_linux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const char* ffProcessAppendOutput(FFstrbuf* buffer, char* const argv[], bool use
6868
{
6969
kill(childPid, SIGTERM);
7070
waitpid(childPid, NULL, 0);
71-
return "poll(&pollfd, 1, timeout) timeout";
71+
return "poll(&pollfd, 1, timeout) timeout (try increasing --processing-timeout)";
7272
}
7373
else if (pollfd.revents & POLLERR)
7474
{

src/common/processing_windows.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ const char* ffProcessAppendOutput(FFstrbuf* buffer, char* const argv[], bool use
9696
{
9797
CancelIo(hChildPipeRead);
9898
TerminateProcess(hProcess, 1);
99-
return "WaitForSingleObject(hChildPipeRead) failed or timeout";
99+
return "WaitForSingleObject(hChildPipeRead) failed or timeout (try increasing --processing-timeout)";
100100
}
101101

102102
if (!GetOverlappedResult(hChildPipeRead, &overlapped, &nRead, FALSE))

src/detection/camera/camera_apple.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
#include "camera.h"
2+
#include "common/io/io.h"
23

34
#import <AVFoundation/AVCaptureDevice.h>
45

56
const char* ffDetectCamera(FFlist* result)
67
{
7-
AVCaptureDeviceDiscoverySession* session = [AVCaptureDeviceDiscoverySession discoverySessionWithDeviceTypes:@[AVCaptureDeviceTypeBuiltInWideAngleCamera] mediaType:AVMediaTypeVideo position:AVCaptureDevicePositionUnspecified];
8+
FF_SUPPRESS_IO(); // #822
9+
AVCaptureDeviceDiscoverySession* session = [AVCaptureDeviceDiscoverySession discoverySessionWithDeviceTypes:@[AVCaptureDeviceTypeBuiltInWideAngleCamera, AVCaptureDeviceTypeExternalUnknown]
10+
mediaType:AVMediaTypeVideo
11+
position:AVCaptureDevicePositionUnspecified];
812
if (!session)
913
return "Failed to create AVCaptureDeviceDiscoverySession";
1014

src/detection/cpu/cpu_windows.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ inline static const char* detectSpeedByCpuid(FFCPUResult* cpu)
6868

6969
#else
7070

71-
inline static const char* detectSpeedByCpuid(FFCPUResult* cpu)
71+
inline static const char* detectSpeedByCpuid(FF_MAYBE_UNUSED FFCPUResult* cpu)
7272
{
7373
return "Unsupported platform";
7474
}

src/detection/disk/disk.c

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,29 @@
11
#include "disk.h"
22

3-
const char* ffDetectDisksImpl(FFlist* disks);
3+
bool ffDiskMatchMountpoint(FFDiskOptions* options, const char* mountpoint)
4+
{
5+
#ifdef _WIN32
6+
const char separator = ';';
7+
#else
8+
const char separator = ':';
9+
#endif
10+
11+
uint32_t mountpointLength = (uint32_t) strlen(mountpoint);
12+
13+
uint32_t startIndex = 0;
14+
while(startIndex < options->folders.length)
15+
{
16+
uint32_t colonIndex = ffStrbufNextIndexC(&options->folders, startIndex, separator);
17+
18+
uint32_t folderLength = colonIndex - startIndex;
19+
if (folderLength == mountpointLength && memcmp(options->folders.chars + startIndex, mountpoint, mountpointLength) == 0)
20+
return true;
21+
22+
startIndex = colonIndex + 1;
23+
}
24+
25+
return false;
26+
}
427

528
static int compareDisks(const FFDisk* disk1, const FFDisk* disk2)
629
{
@@ -9,7 +32,7 @@ static int compareDisks(const FFDisk* disk1, const FFDisk* disk2)
932

1033
const char* ffDetectDisks(FFDiskOptions* options, FFlist* disks)
1134
{
12-
const char* error = ffDetectDisksImpl(disks);
35+
const char* error = ffDetectDisksImpl(options, disks);
1336

1437
if (error) return error;
1538
if (disks->length == 0) return "No disks found";

src/detection/disk/disk.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,6 @@ typedef struct FFDisk
2626
* If error is not set, disks contains at least one disk.
2727
*/
2828
const char* ffDetectDisks(FFDiskOptions* options, FFlist* disks /* list of FFDisk */);
29+
30+
const char* ffDetectDisksImpl(FFDiskOptions* options, FFlist* disks);
31+
bool ffDiskMatchMountpoint(FFDiskOptions* options, const char* mountpoint);

src/detection/disk/disk_bsd.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ void detectFsInfo(struct statfs* fs, FFDisk* disk)
9090
}
9191
#endif
9292

93-
const char* ffDetectDisksImpl(FFlist* disks)
93+
const char* ffDetectDisksImpl(FFDiskOptions* options, FFlist* disks)
9494
{
9595
int size = getfsstat(NULL, 0, MNT_WAIT);
9696

@@ -103,7 +103,12 @@ const char* ffDetectDisksImpl(FFlist* disks)
103103

104104
for(struct statfs* fs = buf; fs < buf + size; ++fs)
105105
{
106-
if(!ffStrStartsWith(fs->f_mntfromname, "/dev/") && !ffStrEquals(fs->f_fstypename, "zfs"))
106+
if(__builtin_expect(options->folders.length, 0))
107+
{
108+
if(!ffDiskMatchMountpoint(options, fs->f_mntonname))
109+
continue;
110+
}
111+
else if(!ffStrStartsWith(fs->f_mntfromname, "/dev/") && !ffStrEquals(fs->f_fstypename, "zfs"))
107112
continue;
108113

109114
#ifdef __FreeBSD__

0 commit comments

Comments
 (0)