mirror of
https://github.com/MonitorControl/MonitorControl.git
synced 2026-05-15 22:01:08 -06:00
- 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>
32 lines
768 B
Swift
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
|
|
}
|
|
|
|
}
|