mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-15 00:34:08 +09:00
feat: moved from the AppleScript for asking a root access when manipulating the fans to the Helper (SMJobBless + XPC) (#1173)
This commit is contained in:
@@ -313,9 +313,7 @@ internal class FanView: NSStackView {
|
||||
private var maxBtn: NSButton? = nil
|
||||
|
||||
private var speedState: Bool {
|
||||
get {
|
||||
return Store.shared.bool(key: "Sensors_speed", defaultValue: false)
|
||||
}
|
||||
Store.shared.bool(key: "Sensors_speed", defaultValue: false)
|
||||
}
|
||||
private var speed: Double {
|
||||
get {
|
||||
@@ -328,9 +326,7 @@ internal class FanView: NSStackView {
|
||||
private var resetModeAfterSleep: Bool = false
|
||||
|
||||
private var horizontalMargin: CGFloat {
|
||||
get {
|
||||
return self.edgeInsets.top + self.edgeInsets.bottom + (self.spacing*CGFloat(self.arrangedSubviews.count))
|
||||
}
|
||||
self.edgeInsets.top + self.edgeInsets.bottom + (self.spacing*CGFloat(self.arrangedSubviews.count))
|
||||
}
|
||||
|
||||
private var willSleepMode: FanMode? = nil
|
||||
@@ -634,7 +630,7 @@ internal class FanView: NSStackView {
|
||||
}
|
||||
|
||||
@objc private func sleepListener(aNotification: NSNotification) {
|
||||
guard SMCHelper.shared.checkRights() && self.fan.customMode != .automatic else { return }
|
||||
guard SMCHelper.shared.isActive() && self.fan.customMode != .automatic else { return }
|
||||
|
||||
self.willSleepMode = self.fan.customMode
|
||||
self.willSleepSpeed = self.fan.customSpeed
|
||||
|
||||
Reference in New Issue
Block a user