Skip to content

Commit b3d6bcb

Browse files
authored
Merge pull request #57 from fastfetch-cli/dev
upd
2 parents 6aefb02 + 6ef4f62 commit b3d6bcb

File tree

12 files changed

+202
-109
lines changed

12 files changed

+202
-109
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ jobs:
575575
version: '7.6'
576576
run: |
577577
uname -a
578-
sudo pkg_add -r cmake git pkgconf wayland vulkan-headers vulkan-loader glib2 dconf dbus sqlite3 xfconf imagemagick chafa pulseaudio hwdata
578+
sudo pkg_add -r cmake git pkgconf wayland vulkan-headers vulkan-loader glib2 dconf dbus sqlite3 xfconf imagemagick chafa
579579
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DENABLE_EMBEDDED_PCIIDS=On -DENABLE_EMBEDDED_AMDGPUIDS=On .
580580
cmake --build . --target package --verbose -j4
581581
./fastfetch --list-features
@@ -611,7 +611,7 @@ jobs:
611611
version: '10.1'
612612
run: |
613613
uname -a
614-
sudo pkgin -y install cmake git pkgconf wayland vulkan-headers dconf dbus sqlite3 ImageMagick pulseaudio opencl-headers ocl-icd
614+
sudo pkgin -y install cmake git pkgconf wayland vulkan-headers dconf dbus sqlite3 ImageMagick opencl-headers ocl-icd
615615
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DENABLE_EMBEDDED_PCIIDS=On -DENABLE_EMBEDDED_AMDGPUIDS=On .
616616
cmake --build . --target package --verbose -j4
617617
./fastfetch --list-features

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
fastfetch (2.38.0) jammy; urgency=medium
2+
3+
* Update to 2.38.0
4+
5+
-- Carter Li <[email protected]> Wed, 05 Mar 2025 14:56:24 +0800
6+
17
fastfetch (2.37.0) jammy; urgency=medium
28

39
* Update to 2.37.0

debian/files

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
fastfetch_2.37.0_source.buildinfo universe/utils optional
1+
fastfetch_2.38.0_source.buildinfo universe/utils optional

src/detection/displayserver/displayserver_windows.c

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -189,26 +189,47 @@ static void detectDisplays(FFDisplayServerResult* ds)
189189

190190
if (display)
191191
{
192-
DISPLAYCONFIG_GET_ADVANCED_COLOR_INFO advColorInfo = {
192+
DISPLAYCONFIG_GET_ADVANCED_COLOR_INFO_2 advColorInfo2 = {
193193
.header = {
194-
.type = DISPLAYCONFIG_DEVICE_INFO_GET_ADVANCED_COLOR_INFO,
195-
.size = sizeof(advColorInfo),
194+
.type = DISPLAYCONFIG_DEVICE_INFO_GET_ADVANCED_COLOR_INFO_2,
195+
.size = sizeof(advColorInfo2),
196196
.adapterId = path->targetInfo.adapterId,
197197
.id = path->targetInfo.id,
198198
}
199199
};
200-
if (DisplayConfigGetDeviceInfo(&advColorInfo.header) == ERROR_SUCCESS)
200+
if (DisplayConfigGetDeviceInfo(&advColorInfo2.header) == ERROR_SUCCESS)
201201
{
202-
if (advColorInfo.advancedColorEnabled)
202+
if (advColorInfo2.highDynamicRangeUserEnabled)
203203
display->hdrStatus = FF_DISPLAY_HDR_STATUS_ENABLED;
204-
else if (advColorInfo.advancedColorSupported)
204+
else if (advColorInfo2.highDynamicRangeSupported)
205205
display->hdrStatus = FF_DISPLAY_HDR_STATUS_SUPPORTED;
206206
else
207207
display->hdrStatus = FF_DISPLAY_HDR_STATUS_UNSUPPORTED;
208-
display->bitDepth = (uint8_t) advColorInfo.bitsPerColorChannel;
208+
display->bitDepth = (uint8_t) advColorInfo2.bitsPerColorChannel;
209209
}
210210
else
211-
display->hdrStatus = FF_DISPLAY_HDR_STATUS_UNKNOWN;
211+
{
212+
DISPLAYCONFIG_GET_ADVANCED_COLOR_INFO advColorInfo = {
213+
.header = {
214+
.type = DISPLAYCONFIG_DEVICE_INFO_GET_ADVANCED_COLOR_INFO,
215+
.size = sizeof(advColorInfo),
216+
.adapterId = path->targetInfo.adapterId,
217+
.id = path->targetInfo.id,
218+
}
219+
};
220+
if (DisplayConfigGetDeviceInfo(&advColorInfo.header) == ERROR_SUCCESS)
221+
{
222+
if (advColorInfo.advancedColorEnabled)
223+
display->hdrStatus = FF_DISPLAY_HDR_STATUS_ENABLED;
224+
else if (advColorInfo.advancedColorSupported)
225+
display->hdrStatus = FF_DISPLAY_HDR_STATUS_SUPPORTED;
226+
else
227+
display->hdrStatus = FF_DISPLAY_HDR_STATUS_UNSUPPORTED;
228+
display->bitDepth = (uint8_t) advColorInfo.bitsPerColorChannel;
229+
}
230+
else
231+
display->hdrStatus = FF_DISPLAY_HDR_STATUS_UNKNOWN;
232+
}
212233
if (edidLength > 0)
213234
ffEdidGetSerialAndManufactureDate(edidData, &display->serial, &display->manufactureYear, &display->manufactureWeek);
214235
}

src/detection/terminalshell/terminalshell.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@
2020
#include "util/windows/version.h"
2121
#include <windows.h>
2222

23-
static bool getFileVersion(const FFstrbuf* exePath, FFstrbuf* version)
23+
static bool getFileVersion(const FFstrbuf* exePath, const wchar_t* stringName, FFstrbuf* version)
2424
{
2525
wchar_t exePathW[PATH_MAX];
2626
int len = MultiByteToWideChar(CP_UTF8, 0, exePath->chars, (int)exePath->length, exePathW, ARRAY_SIZE(exePathW));
2727
if (len <= 0) return false;
28-
return ffGetFileVersion(exePathW, version);
28+
return ffGetFileVersion(exePathW, stringName, version);
2929
}
30+
3031
#elif __HAIKU__
3132
#include "util/haiku/version.h"
3233
#endif
@@ -98,7 +99,7 @@ static bool getShellVersionPwsh(FFstrbuf* exe, FFstrbuf* version)
9899
}
99100

100101
#ifdef _WIN32
101-
if(getFileVersion(exe, version))
102+
if(getFileVersion(exe, NULL, version))
102103
{
103104
ffStrbufSubstrBeforeLastC(version, '.');
104105
return true;
@@ -291,7 +292,7 @@ bool fftsGetShellVersion(FFstrbuf* exe, const char* exeName, FFstrbuf* exePath,
291292
if(ffStrEqualsIgnCase(exeName, "powershell") || ffStrEqualsIgnCase(exeName, "powershell_ise"))
292293
return getShellVersionWinPowerShell(exe, version);
293294

294-
return getFileVersion(exe, version);
295+
return getFileVersion(exe, NULL, version);
295296
#endif
296297

297298
return false;
@@ -737,7 +738,7 @@ static bool getTerminalVersionWindowsTerminal(FFstrbuf* exe, FFstrbuf* version)
737738
return true;
738739
}
739740

740-
return getFileVersion(exe, version);
741+
return getFileVersion(exe, NULL, version);
741742
}
742743

743744
static bool getTerminalVersionConEmu(FFstrbuf* exe, FFstrbuf* version)
@@ -747,7 +748,7 @@ static bool getTerminalVersionConEmu(FFstrbuf* exe, FFstrbuf* version)
747748
if(version->length)
748749
return true;
749750

750-
return getFileVersion(exe, version);
751+
return getFileVersion(exe, NULL, version);
751752
}
752753

753754
#endif
@@ -839,6 +840,9 @@ bool fftsGetTerminalVersion(FFstrbuf* processName, FF_MAYBE_UNUSED FFstrbuf* exe
839840
if(ffStrbufStartsWithIgnCaseS(processName, "ConEmu"))
840841
return getTerminalVersionConEmu(exe, version);
841842

843+
if(ffStrbufIgnCaseEqualS(processName, "warp.exe"))
844+
return getFileVersion(exe, L"ProductVersion", version);
845+
842846
#endif
843847

844848
#ifndef _WIN32
@@ -914,7 +918,7 @@ bool fftsGetTerminalVersion(FFstrbuf* processName, FF_MAYBE_UNUSED FFstrbuf* exe
914918

915919
#ifdef _WIN32
916920

917-
return getFileVersion(exe, version);
921+
return getFileVersion(exe, NULL, version);
918922

919923
#else
920924

src/detection/terminalshell/terminalshell_windows.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ static void setShellInfoDetails(FFShellResult* result)
8787
if(wcsncmp(module.szModule, L"clink_dll_", strlen("clink_dll_")) == 0)
8888
{
8989
ffStrbufAppendS(&result->prettyName, " (with Clink ");
90-
ffGetFileVersion(module.szExePath, &result->prettyName);
90+
ffGetFileVersion(module.szExePath, NULL, &result->prettyName);
9191
ffStrbufAppendC(&result->prettyName, ')');
9292
break;
9393
}

src/detection/wifi/wifi_apple.m

Lines changed: 39 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -21,44 +21,41 @@ @interface CWInterface()
2121
return CFBridgingRelease(result);
2222
}
2323

24-
static NSDictionary* getWifiInfoBySystemProfiler(NSString* ifName)
24+
static bool queryIpconfig(const char* ifName, FFstrbuf* result)
2525
{
26-
// Warning: costs about 2s on my machine
27-
static NSArray* spData;
28-
static bool inited;
29-
if (!inited)
30-
{
31-
inited = true;
32-
FF_STRBUF_AUTO_DESTROY buffer = ffStrbufCreate();
33-
if (ffProcessAppendStdOut(&buffer, (char* const[]) {
34-
"system_profiler",
35-
"SPAirPortDataType",
36-
"-xml",
37-
"-detailLevel",
38-
"basic",
39-
NULL
40-
}) != NULL)
41-
return nil;
42-
43-
spData = [NSPropertyListSerialization propertyListWithData:[NSData dataWithBytes:buffer.chars length:buffer.length]
44-
options:NSPropertyListImmutable
45-
format:nil
46-
error:nil];
47-
}
26+
return ffProcessAppendStdOut(result, (char* const[]) {
27+
"/usr/sbin/ipconfig",
28+
"getsummary",
29+
(char* const) ifName,
30+
NULL
31+
}) == NULL;
32+
}
4833

49-
if (spData)
50-
{
51-
for (NSDictionary* data in spData[0][@"_items"])
52-
{
53-
for (NSDictionary* inf in data[@"spairport_airport_interfaces"])
54-
{
55-
if ([ifName isEqualToString:inf[@"_name"]])
56-
return inf[@"spairport_current_network_information"];
57-
}
58-
}
59-
}
34+
static bool getWifiInfoByIpconfig(FFstrbuf* ipconfig, const char* prefix, FFstrbuf* result)
35+
{
36+
// `ipconfig getsummary <interface>` returns a string like this:
37+
// <dictionary> {
38+
// BSSID : <redacted>
39+
// IPv4 : <array> {
40+
// ...
41+
// }
42+
// IPv6 : <array> {
43+
// ...
44+
// }
45+
// InterfaceType : WiFi
46+
// LinkStatusActive : TRUE
47+
// NetworkID : XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
48+
// SSID : XXXXXX
49+
// Security : WPA2_PSK
50+
// }
6051

61-
return NULL;
52+
const char* start = memmem(ipconfig->chars, ipconfig->length, prefix, strlen(prefix));
53+
if (!start) return false;
54+
start += strlen(prefix);
55+
const char* end = strchr(start, '\n');
56+
if (!end) return false;
57+
ffStrbufSetNS(result, (uint32_t) (end - start), start);
58+
return false;
6259
}
6360

6461
const char* ffDetectWifi(FFlist* result)
@@ -93,21 +90,23 @@ @interface CWInterface()
9390
continue;
9491

9592
NSDictionary* apple = nil; // For getWifiInfoByApple80211
96-
NSDictionary* sp = nil; // For getWifiInfoBySystemProfiler
93+
FF_STRBUF_AUTO_DESTROY ipconfig = ffStrbufCreate();
9794

9895
if (inf.ssid) // https://developer.apple.com/forums/thread/732431
9996
ffStrbufAppendS(&item->conn.ssid, inf.ssid.UTF8String);
10097
else if (apple || (apple = getWifiInfoByApple80211(inf)))
10198
ffStrbufAppendS(&item->conn.ssid, [apple[@"SSID_STR"] UTF8String]);
102-
else if (sp || (sp = getWifiInfoBySystemProfiler(inf.interfaceName)))
103-
ffStrbufAppendS(&item->conn.ssid, [sp[@"_name"] UTF8String]);
99+
else if (ipconfig.length || (queryIpconfig(item->inf.description.chars, &ipconfig)))
100+
getWifiInfoByIpconfig(&ipconfig, "\n SSID : ", &item->conn.ssid);
104101
else
105102
ffStrbufSetStatic(&item->conn.ssid, "<unknown ssid>"); // https://developer.apple.com/forums/thread/732431
106103

107104
if (inf.bssid)
108105
ffStrbufAppendS(&item->conn.bssid, inf.bssid.UTF8String);
109106
else if (apple || (apple = getWifiInfoByApple80211(inf)))
110107
ffStrbufAppendS(&item->conn.bssid, [apple[@"BSSID"] UTF8String]);
108+
else if (ipconfig.length || (queryIpconfig(item->inf.description.chars, &ipconfig)))
109+
getWifiInfoByIpconfig(&ipconfig, "\n BSSID : ", &item->conn.bssid);
111110

112111
switch(inf.activePHYMode)
113112
{
@@ -138,22 +137,6 @@ @interface CWInterface()
138137
default:
139138
if (inf.activePHYMode < 8)
140139
ffStrbufAppendF(&item->conn.protocol, "Unknown (%ld)", inf.activePHYMode);
141-
else if (sp || (sp = getWifiInfoBySystemProfiler(inf.interfaceName)))
142-
{
143-
ffStrbufSetS(&item->conn.protocol, [sp[@"spairport_network_phymode"] UTF8String]);
144-
if (ffStrbufStartsWithS(&item->conn.protocol, "802.11"))
145-
{
146-
const char* subProtocol = item->conn.protocol.chars + strlen("802.11");
147-
if (ffStrEquals(subProtocol, "be"))
148-
ffStrbufSetStatic(&item->conn.protocol, "802.11be (Wi-Fi 7)");
149-
else if (ffStrEquals(subProtocol, "ax"))
150-
ffStrbufSetStatic(&item->conn.protocol, "802.11ax (Wi-Fi 6)");
151-
else if (ffStrEquals(subProtocol, "ac"))
152-
ffStrbufSetStatic(&item->conn.protocol, "802.11ac (Wi-Fi 5)");
153-
else if (ffStrEquals(subProtocol, "n"))
154-
ffStrbufSetStatic(&item->conn.protocol, "802.11n (Wi-Fi 4)");
155-
}
156-
}
157140
break;
158141
}
159142
item->conn.signalQuality = (double) (inf.rssiValue >= -50 ? 100 : inf.rssiValue <= -100 ? 0 : (inf.rssiValue + 100) * 2);
@@ -266,26 +249,8 @@ @interface CWInterface()
266249
}
267250
}
268251
}
269-
else if (sp || (sp = getWifiInfoBySystemProfiler(inf.interfaceName)))
270-
{
271-
ffStrbufSetS(&item->conn.security, [sp[@"spairport_security_mode"] UTF8String]);
272-
ffStrbufSubstrAfterFirstS(&item->conn.security, "_mode_");
273-
if (ffStrbufEqualS(&item->conn.security, "none"))
274-
ffStrbufSetStatic(&item->conn.security, "Insecure");
275-
else
276-
{
277-
ffStrbufReplaceAllC(&item->conn.security, '_', ' ');
278-
if (ffStrbufStartsWithS(&item->conn.security, "wpa"))
279-
{
280-
item->conn.security.chars[0] = 'W';
281-
item->conn.security.chars[1] = 'P';
282-
item->conn.security.chars[2] = 'A';
283-
char* sub = strchr(item->conn.security.chars, ' ');
284-
if (sub && sub[1])
285-
sub[1] = (char) toupper(sub[1]);
286-
}
287-
}
288-
}
252+
else if (ipconfig.length || (queryIpconfig(item->inf.description.chars, &ipconfig)))
253+
getWifiInfoByIpconfig(&ipconfig, "\n Security : ", &item->conn.security);
289254
break;
290255
default:
291256
ffStrbufAppendF(&item->conn.security, "Unknown (%ld)", inf.security);

src/detection/wm/wm_windows.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ const char* ffDetectWMVersion(const FFstrbuf* wmName, FFstrbuf* result, FF_MAYBE
7979
wchar_t fullPath[MAX_PATH];
8080
wcscpy(fullPath, pPath);
8181
wcscat(fullPath, L"\\dwm.exe");
82-
ffGetFileVersion(fullPath, result);
82+
ffGetFileVersion(fullPath, NULL, result);
8383
}
8484
CoTaskMemFree(pPath);
8585
return NULL;

src/logo/builtin.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,6 +1093,16 @@ static const FFlogo C[] = {
10931093
.colorKeys = FF_COLOR_FG_BLUE,
10941094
.colorTitle = FF_COLOR_FG_WHITE,
10951095
},
1096+
// Common Torizon
1097+
{
1098+
.names = {"common-torizon"},
1099+
.lines = FASTFETCH_DATATEXT_LOGO_TORIZONCORE,
1100+
.colors = {
1101+
FF_COLOR_FG_LIGHT_WHITE,
1102+
FF_COLOR_FG_YELLOW,
1103+
FF_COLOR_FG_BLUE
1104+
},
1105+
},
10961106
// Cosmic DE
10971107
{
10981108
.names = {"Cosmic"},

0 commit comments

Comments
 (0)