feat: combine StatsKit and ModuleKit in the one framework: Kit
|
Before Width: | Height: | Size: 162 B After Width: | Height: | Size: 162 B |
|
Before Width: | Height: | Size: 215 B After Width: | Height: | Size: 215 B |
|
Before Width: | Height: | Size: 305 B After Width: | Height: | Size: 305 B |
|
Before Width: | Height: | Size: 222 B After Width: | Height: | Size: 222 B |
|
Before Width: | Height: | Size: 383 B After Width: | Height: | Size: 383 B |
|
Before Width: | Height: | Size: 535 B After Width: | Height: | Size: 535 B |
|
Before Width: | Height: | Size: 204 B After Width: | Height: | Size: 204 B |
|
Before Width: | Height: | Size: 363 B After Width: | Height: | Size: 363 B |
|
Before Width: | Height: | Size: 515 B After Width: | Height: | Size: 515 B |
|
Before Width: | Height: | Size: 330 B After Width: | Height: | Size: 330 B |
|
Before Width: | Height: | Size: 551 B After Width: | Height: | Size: 551 B |
|
Before Width: | Height: | Size: 772 B After Width: | Height: | Size: 772 B |
|
Before Width: | Height: | Size: 490 B After Width: | Height: | Size: 490 B |
|
Before Width: | Height: | Size: 851 B After Width: | Height: | Size: 851 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -19,6 +19,6 @@
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved.</string>
|
||||
<string>Copyright © 2021 Serhiy Mytrovtsiy. All rights reserved.</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// BarChart.swift
|
||||
// ModuleKit
|
||||
// Kit
|
||||
//
|
||||
// Created by Serhiy Mytrovtsiy on 26/04/2020.
|
||||
// Using Swift 5.0.
|
||||
@@ -10,7 +10,6 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
|
||||
public class BarChart: WidgetWrapper {
|
||||
private var labelState: Bool = false
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// Battery.swift
|
||||
// ModuleKit
|
||||
// Kit
|
||||
//
|
||||
// Created by Serhiy Mytrovtsiy on 06/06/2020.
|
||||
// Using Swift 5.0.
|
||||
@@ -10,7 +10,6 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
|
||||
public class BatterykWidget: WidgetWrapper {
|
||||
private var additional: String = "none"
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// Label.swift
|
||||
// ModuleKit
|
||||
// Kit
|
||||
//
|
||||
// Created by Serhiy Mytrovtsiy on 30/03/2021.
|
||||
// Using Swift 5.0.
|
||||
@@ -10,7 +10,6 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
|
||||
public class Label: WidgetWrapper {
|
||||
private var label: String
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// Chart.swift
|
||||
// ModuleKit
|
||||
// Kit
|
||||
//
|
||||
// Created by Serhiy Mytrovtsiy on 18/04/2020.
|
||||
// Using Swift 5.0.
|
||||
@@ -10,7 +10,6 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
|
||||
public class LineChart: WidgetWrapper {
|
||||
private var labelState: Bool = false
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// Memory.swift
|
||||
// ModuleKit
|
||||
// Kit
|
||||
//
|
||||
// Created by Serhiy Mytrovtsiy on 30/06/2020.
|
||||
// Using Swift 5.0.
|
||||
@@ -10,7 +10,6 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
|
||||
public class MemoryWidget: WidgetWrapper {
|
||||
private var orderReversedState: Bool = false
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// Mini.swift
|
||||
// ModuleKit
|
||||
// Kit
|
||||
//
|
||||
// Created by Serhiy Mytrovtsiy on 10/04/2020.
|
||||
// Using Swift 5.0.
|
||||
@@ -10,7 +10,6 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
|
||||
public class Mini: WidgetWrapper {
|
||||
private var labelState: Bool = true
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// NetworkChart.swift
|
||||
// ModuleKit
|
||||
// Kit
|
||||
//
|
||||
// Created by Serhiy Mytrovtsiy on 19/01/2021.
|
||||
// Using Swift 5.0.
|
||||
@@ -10,7 +10,6 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
|
||||
public class NetworkChart: WidgetWrapper {
|
||||
private var boxState: Bool = false
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// PieChart.swift
|
||||
// ModuleKit
|
||||
// Kit
|
||||
//
|
||||
// Created by Serhiy Mytrovtsiy on 30/11/2020.
|
||||
// Using Swift 5.0.
|
||||
@@ -10,7 +10,6 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
|
||||
public class PieChart: WidgetWrapper {
|
||||
private var labelState: Bool = false
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// Sensors.swift
|
||||
// ModuleKit
|
||||
// Kit
|
||||
//
|
||||
// Created by Serhiy Mytrovtsiy on 17/06/2020.
|
||||
// Using Swift 5.0.
|
||||
@@ -10,7 +10,6 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
|
||||
public class SensorsWidget: WidgetWrapper {
|
||||
private var modeState: String = "automatic"
|
||||
@@ -186,20 +185,20 @@ public class SensorsWidget: WidgetWrapper {
|
||||
public override func settings(width: CGFloat) -> NSView {
|
||||
let view = SettingsContainerView(width: width)
|
||||
|
||||
view.addArrangedSubview(selectRow(
|
||||
frame: NSRect(x: 0, y: 0, width: view.frame.width, height: Constants.Settings.row),
|
||||
title: localizedString("Display mode"),
|
||||
action: #selector(changeMode),
|
||||
items: SensorsWidgetMode,
|
||||
selected: self.modeState
|
||||
))
|
||||
|
||||
view.addArrangedSubview(toggleTitleRow(
|
||||
frame: NSRect(x: 0, y: 0, width: view.frame.width, height: Constants.Settings.row),
|
||||
title: localizedString("Static width"),
|
||||
action: #selector(toggleSize),
|
||||
state: self.fixedSizeState
|
||||
))
|
||||
// view.addArrangedSubview(selectRow(
|
||||
// frame: NSRect(x: 0, y: 0, width: view.frame.width, height: Constants.Settings.row),
|
||||
// title: localizedString("Display mode"),
|
||||
// action: #selector(changeMode),
|
||||
// items: SensorsWidgetMode,
|
||||
// selected: self.modeState
|
||||
// ))
|
||||
//
|
||||
// view.addArrangedSubview(toggleTitleRow(
|
||||
// frame: NSRect(x: 0, y: 0, width: view.frame.width, height: Constants.Settings.row),
|
||||
// title: localizedString("Static width"),
|
||||
// action: #selector(toggleSize),
|
||||
// state: self.fixedSizeState
|
||||
// ))
|
||||
|
||||
return view
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// Speed.swift
|
||||
// ModuleKit
|
||||
// Kit
|
||||
//
|
||||
// Created by Serhiy Mytrovtsiy on 24/05/2020.
|
||||
// Using Swift 5.0.
|
||||
@@ -10,7 +10,6 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
|
||||
public class SpeedWidget: WidgetWrapper {
|
||||
private var icon: String = "dots"
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// constants.swift
|
||||
// StatsKit
|
||||
// Kit
|
||||
//
|
||||
// Created by Serhiy Mytrovtsiy on 15/04/2020.
|
||||
// Using Swift 5.0.
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// extensions.swift
|
||||
// StatsKit
|
||||
// Kit
|
||||
//
|
||||
// Created by Serhiy Mytrovtsiy on 10/04/2020.
|
||||
// Using Swift 5.0.
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// helpers.swift
|
||||
// StatsKit
|
||||
// Kit
|
||||
//
|
||||
// Created by Serhiy Mytrovtsiy on 29/09/2020.
|
||||
// Using Swift 5.0.
|
||||
@@ -12,6 +12,26 @@
|
||||
|
||||
import Cocoa
|
||||
import os.log
|
||||
import ServiceManagement
|
||||
|
||||
public struct LaunchAtLogin {
|
||||
private static let id = "\(Bundle.main.bundleIdentifier!).LaunchAtLogin"
|
||||
|
||||
public static var isEnabled: Bool {
|
||||
get {
|
||||
guard let jobs = (SMCopyAllJobDictionaries(kSMDomainUserLaunchd).takeRetainedValue() as? [[String: AnyObject]]) else {
|
||||
return false
|
||||
}
|
||||
|
||||
let job = jobs.first { $0["Label"] as! String == id }
|
||||
|
||||
return job?["OnDemand"] as? Bool ?? false
|
||||
}
|
||||
set {
|
||||
SMLoginItemSetEnabled(id as CFString, newValue)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public protocol KeyValue_p {
|
||||
var key: String { get }
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// module.swift
|
||||
// ModuleKit
|
||||
// Kit
|
||||
//
|
||||
// Created by Serhiy Mytrovtsiy on 09/04/2020.
|
||||
// Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved.
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
import Cocoa
|
||||
import os.log
|
||||
import StatsKit
|
||||
|
||||
public protocol Module_p {
|
||||
var available: Bool { get }
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// popup.swift
|
||||
// ModuleKit
|
||||
// Kit
|
||||
//
|
||||
// Created by Serhiy Mytrovtsiy on 11/04/2020.
|
||||
// Using Swift 5.0.
|
||||
@@ -10,7 +10,6 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
|
||||
public protocol Popup_p: NSView {
|
||||
var sizeCallback: ((NSSize) -> Void)? { get set }
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// reader.swift
|
||||
// ModuleKit
|
||||
// Kit
|
||||
//
|
||||
// Created by Serhiy Mytrovtsiy on 10/04/2020.
|
||||
// Using Swift 5.0.
|
||||
@@ -12,7 +12,6 @@
|
||||
import Cocoa
|
||||
import Repeat
|
||||
import os.log
|
||||
import StatsKit
|
||||
|
||||
public protocol value_t {
|
||||
var widgetValue: Double { get }
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// settings.swift
|
||||
// ModuleKit
|
||||
// Kit
|
||||
//
|
||||
// Created by Serhiy Mytrovtsiy on 13/04/2020.
|
||||
// Using Swift 5.0.
|
||||
@@ -10,7 +10,6 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
|
||||
public protocol Settings_p: NSView {
|
||||
var toggleCallback: () -> Void { get set }
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// widget.swift
|
||||
// ModuleKit
|
||||
// Kit
|
||||
//
|
||||
// Created by Serhiy Mytrovtsiy on 10/04/2020.
|
||||
// Using Swift 5.0.
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
import Cocoa
|
||||
import os.log
|
||||
import StatsKit
|
||||
|
||||
public enum widget_t: String {
|
||||
case unknown = ""
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// Chart.swift
|
||||
// StatsKit
|
||||
// Kit
|
||||
//
|
||||
// Created by Serhiy Mytrovtsiy on 17/04/2020.
|
||||
// Using Swift 5.0.
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// SMC.swift
|
||||
// StatsKit
|
||||
// Kit
|
||||
//
|
||||
// Created by Serhiy Mytrovtsiy on 05/04/2020.
|
||||
// Using Swift 5.0.
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// store.swift
|
||||
// StatsKit
|
||||
// Kit
|
||||
//
|
||||
// Created by Serhiy Mytrovtsiy on 10/04/2020.
|
||||
// Using Swift 5.0.
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// SystemKit.swift
|
||||
// Stats
|
||||
// Kit
|
||||
//
|
||||
// Created by Serhiy Mytrovtsiy on 13/04/2020.
|
||||
// Using Swift 5.0.
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// types.swift
|
||||
// StatsKit
|
||||
// Kit
|
||||
//
|
||||
// Created by Serhiy Mytrovtsiy on 10/04/2021.
|
||||
// Using Swift 5.0.
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// updater.swift
|
||||
// StatsKit
|
||||
// Kit
|
||||
//
|
||||
// Created by Serhiy Mytrovtsiy on 14/04/2020.
|
||||
// Using Swift 5.0.
|
||||
@@ -10,8 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
import ModuleKit
|
||||
import Kit
|
||||
import IOKit.ps
|
||||
|
||||
struct Battery_Usage: value_t {
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import ModuleKit
|
||||
import StatsKit
|
||||
import Kit
|
||||
|
||||
internal class Popup: NSView, Popup_p {
|
||||
private var title: String
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
import ModuleKit
|
||||
import Kit
|
||||
import os.log
|
||||
|
||||
internal class UsageReader: Reader<Battery_Usage> {
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
import ModuleKit
|
||||
import Kit
|
||||
import SystemConfiguration
|
||||
|
||||
internal class Settings: NSView, Settings_v {
|
||||
|
||||
@@ -7,8 +7,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import ModuleKit
|
||||
import StatsKit
|
||||
import Kit
|
||||
|
||||
public struct CPU_Load: value_t {
|
||||
var totalUsage: Double = 0
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import ModuleKit
|
||||
import StatsKit
|
||||
import Kit
|
||||
|
||||
internal class Popup: NSView, Popup_p {
|
||||
private var title: String
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
import ModuleKit
|
||||
import Kit
|
||||
import os.log
|
||||
|
||||
internal class LoadReader: Reader<CPU_Load> {
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
import ModuleKit
|
||||
import Kit
|
||||
|
||||
internal class Settings: NSView, Settings_v {
|
||||
private var usagePerCoreState: Bool = false
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
import ModuleKit
|
||||
import Kit
|
||||
|
||||
public struct stats {
|
||||
var read: Int64 = 0
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import ModuleKit
|
||||
import StatsKit
|
||||
import Kit
|
||||
|
||||
internal class Popup: NSView, Popup_p {
|
||||
private let diskFullHeight: CGFloat = 62
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import ModuleKit
|
||||
import StatsKit
|
||||
import Kit
|
||||
import IOKit
|
||||
import Darwin
|
||||
import os.log
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
import ModuleKit
|
||||
import Kit
|
||||
|
||||
internal class Settings: NSView, Settings_v {
|
||||
private var removableState: Bool = false
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
import ModuleKit
|
||||
import Kit
|
||||
|
||||
public struct Fan {
|
||||
public let id: Int
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import ModuleKit
|
||||
import StatsKit
|
||||
import Kit
|
||||
|
||||
internal class Popup: NSStackView, Popup_p {
|
||||
public var sizeCallback: ((NSSize) -> Void)? = nil
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import ModuleKit
|
||||
import StatsKit
|
||||
import Kit
|
||||
import os.log
|
||||
|
||||
internal class FansReader: Reader<[Fan]> {
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
import ModuleKit
|
||||
import Kit
|
||||
|
||||
internal class Settings: NSStackView, Settings_v {
|
||||
private var updateIntervalValue: Int = 1
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import ModuleKit
|
||||
import StatsKit
|
||||
import Kit
|
||||
|
||||
public typealias GPU_type = String
|
||||
public enum GPU_types: GPU_type {
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
import ModuleKit
|
||||
import Kit
|
||||
|
||||
internal class Popup: NSStackView, Popup_p {
|
||||
public var sizeCallback: ((NSSize) -> Void)? = nil
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
import ModuleKit
|
||||
import Kit
|
||||
import os.log
|
||||
|
||||
public struct device {
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
import ModuleKit
|
||||
import Kit
|
||||
|
||||
internal class Settings: NSView, Settings_v {
|
||||
private var updateIntervalValue: Int = 1
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
import ModuleKit
|
||||
import Kit
|
||||
import SystemConfiguration
|
||||
|
||||
public enum Network_t: String {
|
||||
|
||||
@@ -11,8 +11,7 @@
|
||||
// swiftlint:disable file_length
|
||||
|
||||
import Cocoa
|
||||
import ModuleKit
|
||||
import StatsKit
|
||||
import Kit
|
||||
|
||||
// swiftlint:disable type_body_length
|
||||
internal class Popup: NSStackView, Popup_p {
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
import ModuleKit
|
||||
import Kit
|
||||
import SystemConfiguration
|
||||
import Reachability
|
||||
import os.log
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
import ModuleKit
|
||||
import Kit
|
||||
import SystemConfiguration
|
||||
|
||||
internal class Settings: NSView, Settings_v {
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
import ModuleKit
|
||||
import Kit
|
||||
|
||||
public struct RAM_Usage: value_t {
|
||||
var total: Double
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import ModuleKit
|
||||
import StatsKit
|
||||
import Kit
|
||||
|
||||
internal class Popup: NSView, Popup_p {
|
||||
private var title: String
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
import ModuleKit
|
||||
import Kit
|
||||
import os.log
|
||||
|
||||
internal class UsageReader: Reader<RAM_Usage> {
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
import ModuleKit
|
||||
import Kit
|
||||
|
||||
internal class Settings: NSView, Settings_v {
|
||||
private var updateIntervalValue: Int = 1
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import ModuleKit
|
||||
import StatsKit
|
||||
import Kit
|
||||
|
||||
public class Sensors: Module {
|
||||
private var sensorsReader: SensorsReader
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import ModuleKit
|
||||
import StatsKit
|
||||
import Kit
|
||||
|
||||
internal class Popup: NSView, Popup_p {
|
||||
private var list: [String: NSTextField] = [:]
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import ModuleKit
|
||||
import StatsKit
|
||||
import Kit
|
||||
import os.log
|
||||
import IOKit.hid
|
||||
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
import ModuleKit
|
||||
import Kit
|
||||
|
||||
internal class Settings: NSView, Settings_v {
|
||||
private var updateIntervalValue: Int = 3
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
// Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved.
|
||||
//
|
||||
|
||||
import StatsKit
|
||||
import Kit
|
||||
|
||||
enum SensorGroup: String {
|
||||
case CPU = "CPU"
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
import Cocoa
|
||||
import os.log
|
||||
|
||||
import StatsKit
|
||||
import ModuleKit
|
||||
import Kit
|
||||
|
||||
import CPU
|
||||
import RAM
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
import Kit
|
||||
import os.log
|
||||
|
||||
class ApplicationSettings: NSScrollView {
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
import ModuleKit
|
||||
import Kit
|
||||
import os.log
|
||||
|
||||
class Dashboard: NSScrollView {
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import ModuleKit
|
||||
import StatsKit
|
||||
import Kit
|
||||
|
||||
class SettingsWindow: NSWindow, NSWindowDelegate {
|
||||
private let viewController: SettingsViewController = SettingsViewController()
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import StatsKit
|
||||
import Kit
|
||||
import os.log
|
||||
|
||||
class UpdateWindow: NSWindow, NSWindowDelegate {
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import Kit
|
||||
import os.log
|
||||
import StatsKit
|
||||
|
||||
extension AppDelegate {
|
||||
internal func parseArguments() {
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved.</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,15 +0,0 @@
|
||||
//
|
||||
// StatsKit.h
|
||||
// StatsKit
|
||||
//
|
||||
// Created by Serhiy Mytrovtsiy on 14/04/2020.
|
||||
// Using Swift 5.0.
|
||||
// Running on macOS 10.15.
|
||||
//
|
||||
// Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
FOUNDATION_EXPORT double StatsKitVersionNumber;
|
||||
FOUNDATION_EXPORT const unsigned char StatsKitVersionString[];
|
||||
@@ -1,32 +0,0 @@
|
||||
//
|
||||
// launchAtLogin.swift
|
||||
// StatsKit
|
||||
//
|
||||
// Created by Serhiy Mytrovtsiy on 14/04/2020.
|
||||
// Using Swift 5.0.
|
||||
// Running on macOS 10.15.
|
||||
//
|
||||
// Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import ServiceManagement
|
||||
|
||||
public struct LaunchAtLogin {
|
||||
private static let id = "\(Bundle.main.bundleIdentifier!).LaunchAtLogin"
|
||||
|
||||
public static var isEnabled: Bool {
|
||||
get {
|
||||
guard let jobs = (SMCopyAllJobDictionaries(kSMDomainUserLaunchd).takeRetainedValue() as? [[String: AnyObject]]) else {
|
||||
return false
|
||||
}
|
||||
|
||||
let job = jobs.first { $0["Label"] as! String == id }
|
||||
|
||||
return job?["OnDemand"] as? Bool ?? false
|
||||
}
|
||||
set {
|
||||
SMLoginItemSetEnabled(id as CFString, newValue)
|
||||
}
|
||||
}
|
||||
}
|
||||