37 lines
1.1 KiB
Swift
37 lines
1.1 KiB
Swift
import SwiftUI
|
|
|
|
/// Main entry point for the CommandNotch application.
|
|
/// Provides a MenuBarExtra for quick access to settings and app controls.
|
|
/// The notch windows and terminal sessions are managed by AppDelegate + ScreenManager.
|
|
@main
|
|
struct CommandNotchApp: App {
|
|
|
|
@NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
|
|
|
|
@AppStorage(NotchSettings.Keys.showMenuBarIcon)
|
|
private var showMenuBarIcon = NotchSettings.Defaults.showMenuBarIcon
|
|
|
|
var body: some Scene {
|
|
MenuBarExtra("CommandNotch", systemImage: "terminal", isInserted: $showMenuBarIcon) {
|
|
Button("Toggle Notch") {
|
|
ScreenManager.shared.toggleNotchOnActiveScreen()
|
|
}
|
|
.keyboardShortcut(.return, modifiers: .command)
|
|
|
|
Divider()
|
|
|
|
Button("Settings...") {
|
|
SettingsWindowController.shared.showSettings()
|
|
}
|
|
.keyboardShortcut(",", modifiers: .command)
|
|
|
|
Divider()
|
|
|
|
Button("Quit CommandNotch") {
|
|
NSApplication.shared.terminate(nil)
|
|
}
|
|
.keyboardShortcut("Q", modifiers: .command)
|
|
}
|
|
}
|
|
}
|