mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Wifi (macOS): work around #581
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
# 2.1.1
|
||||
|
||||
Changes:
|
||||
* SSID detection no longer works in macOS Sonoma. It will be marked as `<unknown ssid>` before I find a solution (Wifi, macOS)
|
||||
|
||||
Features:
|
||||
* Support opkg (Packages, Linux)
|
||||
* Support GNOME Console terminal version and font detection (Terminal, Linux)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "wifi.h"
|
||||
#include "common/processing.h"
|
||||
|
||||
#import <CoreWLAN/CoreWLAN.h>
|
||||
|
||||
@@ -33,6 +34,17 @@ const char* ffDetectWifi(FFlist* result)
|
||||
|
||||
if (inf.ssid)
|
||||
ffStrbufAppendS(&item->conn.ssid, inf.ssid.UTF8String);
|
||||
else if (!ffProcessAppendStdOut(&item->conn.ssid, (char* []) {
|
||||
"/usr/sbin/networksetup",
|
||||
"-getairportnetwork",
|
||||
item->inf.description.chars,
|
||||
NULL
|
||||
}) && item->conn.ssid.length > 0)
|
||||
{
|
||||
uint32_t index = ffStrbufFirstIndexC(&item->conn.ssid, ':');
|
||||
if (index < item->conn.ssid.length)
|
||||
ffStrbufSubstrAfter(&item->conn.ssid, index + 1);
|
||||
}
|
||||
else
|
||||
ffStrbufSetStatic(&item->conn.ssid, "<unknown ssid>"); // https://developer.apple.com/forums/thread/732431
|
||||
|
||||
|
||||
Reference in New Issue
Block a user