Skip to content

Commit b3945e2

Browse files
committed
Global: review code
1 parent 9f77851 commit b3945e2

File tree

8 files changed

+19
-39
lines changed

8 files changed

+19
-39
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,26 @@ Changes:
66

77
Features:
88
* Add `ENABLE_PROPRIETARY_GPU_DRIVER_API` cmake option to disable using of proprietary GPU driver APIs (GPU)
9+
* Support wallpaper detection for macOS Sonoma (Wallpaper, macOS)
910
* Support power adapter detection for Asahi Linux (PowerAdapter, Linux)
1011
* Support battery serial number and manufacturer date detection (Battery)
1112
* Support host serial number and UUID detection (Host)
1213
* Support battery level detection for gamepads where possible (Gamepad)
1314
* Support maximum CPU clock detection. Previously base clock was printed (CPU, Windows)
1415
* Support manufacture date and serial number detection for physical monitors (Monitor)
15-
* Support ash shell version detection (Shell, Linux)
16+
* Support ash (default shell of BusyBox) version detection (Shell, Linux)
1617
* Sound module in FreeBSD now uses native `ioctl`s. Pulseaudio dependency is no longer used.
1718
* Locale module in Windows now prints the same format as in Linux and other posix systems.
1819

1920
Bugfixes:
20-
* Fix support of macOS Sonoma (Wallpaper, macOS)
2121
* Fix overall memory leaks (macOS)
2222
* Remove trailing `\0` in JSON results (FreeBSD)
2323
* Fix physical monitor detection with Nvidia drivers (Monitor, Linux)
2424
* Don't print llvmpipe in vulkan module (Vulkan)
2525
* Fix system yyjson usage in `fastfetch.c`. Previously embedded `3rdparty/yyjson/yyjson.h` was used in `fastfetch.c` even if `ENABLE_SYSTEM_YYJSON` was set (CMake)
2626
* Fix locale module printing unexpected results in specific environments (Locale)
27+
* Fix battery temperature detection in Windows. Note only smart batteries report temperatures but few laptops uses smart battery (Battery, Windows)
28+
* Print device name if no backlight name is available, so we don't print empty parentheses (Brightness, FreeBSD)
2729

2830
# 2.5.0
2931

doc/json_schema.json

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,10 @@
676676
"const": "gamepad",
677677
"description": "List connected gamepads"
678678
},
679+
{
680+
"const": "host",
681+
"description": "Print product name of your computer"
682+
},
679683
{
680684
"const": "icons",
681685
"description": "Print icon style name"
@@ -1212,28 +1216,6 @@
12121216
},
12131217
"additionalProperties": false
12141218
},
1215-
{
1216-
"title": "Host",
1217-
"properties": {
1218-
"type": {
1219-
"const": "host",
1220-
"description": "Print product name of your computer"
1221-
},
1222-
"key": {
1223-
"$ref": "#/$defs/key"
1224-
},
1225-
"keyColor": {
1226-
"$ref": "#/$defs/keyColor"
1227-
},
1228-
"keyWidth": {
1229-
"$ref": "#/$defs/keyWidth"
1230-
},
1231-
"format": {
1232-
"$ref": "#/$defs/format"
1233-
}
1234-
},
1235-
"additionalProperties": false
1236-
},
12371219
{
12381220
"title": "Local IP",
12391221
"properties": {

presets/examples/9.jsonc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@
1616
"separator",
1717
"memory",
1818
"swap",
19-
{
20-
"type": "disk",
21-
"folders": "/"
22-
},
19+
"disk",
2320
"battery",
2421
{
2522
"type": "colors",

src/detection/terminalfont/terminalfont_apple.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ static void detectWarpTerminal(FFTerminalFontResult* terminalFont)
9393

9494
void ffDetectTerminalFontPlatform(const FFTerminalResult* terminal, FFTerminalFontResult* terminalFont)
9595
{
96-
if(ffStrbufIgnCaseCompS(&terminal->processName, "iterm.app") == 0 ||
96+
if(ffStrbufIgnCaseEqualS(&terminal->processName, "iterm.app") ||
9797
ffStrbufStartsWithIgnCaseS(&terminal->processName, "iTermServer-"))
9898
detectIterm2(terminalFont);
99-
else if(ffStrbufIgnCaseCompS(&terminal->processName, "Apple_Terminal") == 0)
99+
else if(ffStrbufIgnCaseEqualS(&terminal->processName, "Apple_Terminal"))
100100
detectAppleTerminal(terminalFont);
101-
else if(ffStrbufIgnCaseCompS(&terminal->processName, "WarpTerminal") == 0)
101+
else if(ffStrbufIgnCaseEqualS(&terminal->processName, "WarpTerminal"))
102102
detectWarpTerminal(terminalFont);
103103
}

src/detection/terminalfont/terminalfont_windows.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ static void detectConEmu(FFTerminalFontResult* terminalFont)
8787

8888
void ffDetectTerminalFontPlatform(const FFTerminalResult* terminal, FFTerminalFontResult* terminalFont)
8989
{
90-
if(ffStrbufIgnCaseCompS(&terminal->processName, "mintty") == 0)
90+
if(ffStrbufIgnCaseEqualS(&terminal->processName, "mintty"))
9191
detectMintty(terminalFont);
92-
else if(ffStrbufIgnCaseCompS(&terminal->processName, "conhost.exe") == 0)
92+
else if(ffStrbufIgnCaseEqualS(&terminal->processName, "conhost.exe"))
9393
detectConhost(terminalFont);
9494
else if(ffStrbufStartsWithIgnCaseS(&terminal->processName, "ConEmu"))
9595
detectConEmu(terminalFont);

src/detection/terminalshell/terminalshell.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ typedef struct FFShellResult
1515

1616
typedef struct FFTerminalResult
1717
{
18-
1918
FFstrbuf processName;
2019
FFstrbuf exe;
2120
FFstrbuf prettyName;

src/logo/logo.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -502,10 +502,10 @@ void ffLogoPrint(void)
502502

503503
//Terminal emulators that support kitty graphics protocol.
504504
bool supportsKitty =
505-
ffStrbufIgnCaseCompS(&terminal->processName, "kitty") == 0 ||
506-
ffStrbufIgnCaseCompS(&terminal->processName, "konsole") == 0 ||
507-
ffStrbufIgnCaseCompS(&terminal->processName, "wezterm") == 0 ||
508-
ffStrbufIgnCaseCompS(&terminal->processName, "wayst") == 0;
505+
ffStrbufIgnCaseEqualS(&terminal->processName, "kitty") ||
506+
ffStrbufIgnCaseEqualS(&terminal->processName, "konsole") ||
507+
ffStrbufIgnCaseEqualS(&terminal->processName, "wezterm") ||
508+
ffStrbufIgnCaseEqualS(&terminal->processName, "wayst");
509509

510510
//Try to load the logo as an image. If it succeeds, print it and return.
511511
if(logoPrintImageIfExists(supportsKitty ? FF_LOGO_TYPE_IMAGE_KITTY : FF_LOGO_TYPE_IMAGE_CHAFA, false))

src/modules/battery/battery.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ void ffPrintBatteryHelpFormat(void)
226226
"Battery temperature",
227227
"Battery cycle count",
228228
"Battery serial number",
229-
"Battery manufactorDate",
229+
"Battery manufactor date",
230230
});
231231
}
232232

0 commit comments

Comments
 (0)