master ohmu/fastfetch-openbsd / src / detection / lm / lm_apple.m
ohmu  ·  2026-10-15
 1#include "lm.h"
 2
 3#import <Foundation/Foundation.h>
 4
 5const char* ffDetectLM(FFLMResult* result) {
 6    ffStrbufSetStatic(&result->service, "loginwindow");
 7    ffStrbufSetStatic(&result->prettyName, "Login Window");
 8
 9    NSError* error;
10    NSDictionary* dict = [NSDictionary dictionaryWithContentsOfURL:[NSURL fileURLWithPath:@"/System/Library/CoreServices/loginwindow.app/Contents/Info.plist" isDirectory:NO]
11                                                                error:&error];
12
13    if (dict) {
14        ffStrbufSetS(&result->version, ((NSString*) dict[@"CFBundleShortVersionString"]).UTF8String);
15    }
16
17    return nullptr;
18}