mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
feat: small codebase refactoring (mostly removed unused code and changes in access control)
This commit is contained in:
@@ -50,18 +50,12 @@ public struct GPU_Info: Codable {
|
||||
}
|
||||
}
|
||||
|
||||
public struct GPUs: value_t, Codable {
|
||||
public struct GPUs: Codable {
|
||||
public var list: [GPU_Info] = []
|
||||
|
||||
internal func active() -> [GPU_Info] {
|
||||
return self.list.filter{ $0.state && $0.utilization != nil }.sorted{ $0.utilization ?? 0 > $1.utilization ?? 0 }
|
||||
}
|
||||
|
||||
public var widgetValue: Double {
|
||||
get {
|
||||
return list.isEmpty ? 0 : (list[0].utilization ?? 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class GPU: Module {
|
||||
|
||||
Reference in New Issue
Block a user