MonitorControl/MonitorControlHelper/AppDelegate.swift
Guillaume Broder 087bb132c6
🔧 Refactoring + preparing v1.2
- Refactoring of the way the slider are created
- Read the current value of ddcctl monitor after launching the app, so no more value at 0 for the sliders
- When there's only one monitor, display it directly, not in a submenu, closes #10
- Added a "start at login" helper (still need testing) for v1.2

Signed-off-by: Guillaume Broder <iamnotheoneyouseek@gmail.com>
2018-01-13 22:49:10 +01:00

32 lines
768 B
Swift

//
// AppDelegate.swift
// MonitorControlHelper
//
// Created by Guillaume BRODER on 13/01/2018.
// Copyright © 2018 Mathew Kurian. All rights reserved.
//
import Cocoa
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
@IBOutlet weak var window: NSWindow!
func applicationDidFinishLaunching(_ aNotification: Notification) {
let bundlePath = Bundle.main.bundlePath as NSString
var pathComponents = bundlePath.pathComponents
for _ in 0...4 {
pathComponents.removeLast()
}
let path = NSString.path(withComponents: pathComponents)
NSWorkspace.shared.launchApplication(path)
NSApp.terminate(nil)
}
func applicationWillTerminate(_ aNotification: Notification) {
// Insert code here to tear down your application
}
}