A minimal macOS application that displays a simple counter in a popover anchored to the display notch.
- Counter Display: Shows an integer counter.
- Increment/Decrement: Buttons to increase or decrease the counter value.
- Notch Integration:
- The popover appears attached to the screen notch.
- Clicking near the notch area (or a defined trigger) opens/closes the popover.
- The popover automatically closes when the application loses focus.
- Launch at Login: Can be configured to launch automatically when the user logs in.
This application is a significantly stripped-down version of the original NotchDrop application, focusing solely on demonstrating a basic notch-integrated UI with a counter. It's built using SwiftUI for the UI elements and AppKit for window management and system event handling.
AppDelegate.swift: Manages the application lifecycle.NotchViewModel.swift/NotchViewModel+Events.swift: Handles the state (counter value, popover visibility) and event logic (mouse clicks, app focus).NotchContentView.swift: Defines the UI for the counter and buttons.NotchView.swift: The main SwiftUI view for the popover.NotchWindowController.swift/NotchWindow.swift: Manage the custom, transparent window that acts as the popover.EventMonitors.swift/EventMonitor.swift: Handle global mouse event monitoring.main.swift: Application entry point.
- Open
NotchDrop.xcodeprojin Xcode. - Select the
NotchDropscheme. - Build and run the application (Cmd+R).
This project serves as a learning example or a starting point for building more complex macOS notch applications with SwiftUI.