On Apple Silicon set the fan to Auto before sleeping. systemDidWakeFromSleep will set the previous selection on wake

This commit is contained in:
Raafat Akkad
2022-04-07 23:24:39 +01:00
parent 618c22ea89
commit 53b337f15f
6 changed files with 41 additions and 16 deletions

View File

@ -22,6 +22,9 @@
#import "MachineDefaults.h"
#import "NSFileManager+DirectoryLocations.h"
#include <sys/types.h>
#include <sys/sysctl.h>
#include <mach/machine.h>
@interface MachineDefaults ()
{
@ -123,6 +126,14 @@
return defaultsDict;
}
+ (BOOL)isAppleSilicon
{
cpu_type_t cpu_type;
size_t size = sizeof(cpu_type);
sysctlbyname("hw.cputype", &cpu_type, &size, NULL, 0);
return cpu_type == CPU_TYPE_ARM64;
}
+ (NSString *)computerModel
{
static NSString *computerModel = nil;