mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
WM (macOS): add WindowServer version detection
This commit is contained in:
+1
-1
@@ -922,7 +922,7 @@ elseif(APPLE)
|
||||
src/detection/users/users_linux.c
|
||||
src/detection/wallpaper/wallpaper_apple.m
|
||||
src/detection/wifi/wifi_apple.m
|
||||
src/detection/wm/wm_apple.c
|
||||
src/detection/wm/wm_apple.m
|
||||
src/detection/de/de_nosupport.c
|
||||
src/detection/wmtheme/wmtheme_apple.m
|
||||
src/detection/camera/camera_apple.m
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "util/stringUtils.h"
|
||||
|
||||
#include <ctype.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
const char* ffDetectWMPlugin(FFstrbuf* pluginName)
|
||||
{
|
||||
@@ -39,7 +40,18 @@ const char* ffDetectWMPlugin(FFstrbuf* pluginName)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char* ffDetectWMVersion(FF_MAYBE_UNUSED const FFstrbuf* wmName, FF_MAYBE_UNUSED FFstrbuf* result, FF_MAYBE_UNUSED FFWMOptions* options)
|
||||
const char* ffDetectWMVersion(const FFstrbuf* wmName, FFstrbuf* result, FF_MAYBE_UNUSED FFWMOptions* options)
|
||||
{
|
||||
return "Not supported on this platform";
|
||||
if (!wmName)
|
||||
return "No WM detected";
|
||||
|
||||
if (ffStrbufEqualS(wmName, "WindowServer"))
|
||||
{
|
||||
NSError* error;
|
||||
NSDictionary* dict = [NSDictionary dictionaryWithContentsOfURL:[NSURL URLWithString:@"file:///System/Library/CoreServices/WindowManager.app/Contents/version.plist"]
|
||||
error:&error];
|
||||
ffStrbufInitS(result, ((NSString*) dict[@"CFBundleVersion"]).UTF8String);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
Reference in New Issue
Block a user