https://github.com/akselpekin/holdit
A energy efficient macOS notch accessory.
https://github.com/akselpekin/holdit
energy-efficiency macos swift swiftui tray-application
Last synced: 2 months ago
JSON representation
A energy efficient macOS notch accessory.
- Host: GitHub
- URL: https://github.com/akselpekin/holdit
- Owner: akselpekin
- License: lgpl-2.1
- Created: 2025-07-06T18:38:41.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-11-28T13:53:51.000Z (7 months ago)
- Last Synced: 2026-04-15T06:03:29.881Z (3 months ago)
- Topics: energy-efficiency, macos, swift, swiftui, tray-application
- Language: Swift
- Homepage:
- Size: 7.62 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# holdit
A macOS utility accessory that reveals a expanding tray behind the notch when you hover or drag files over it. The tray displays files and folders in a grid, supports drag-and-drop, context menus, batch removal, and keeps its energy impact at Apple’s designated “Low” level.
## Features
- Expanding tray behind the notch on hover or file drag
- Dynamic grid layout of file and folder icons
- Duplicate prevention, drag-out removal, and multi-select
- Context menus for quick actions
- Automatic removal of items whose files no longer exist
- Smooth SwiftUI animations with AppKit tracking for minimal energy use
## Installation (App)
1. See the releases section.
## Installation (source)
1. Clone this repository:
```bash
git clone https://github.com/yourusername/holdit.git
cd holdit
```
2. Build & run:
```bash
swift run
```
## Usage
- Hover over the notch area or drag files onto it to expand the tray.
- Drag items into the tray to add them, or drag them out to remove.
- Right-click an item for context actions.
- Use the status-bar menu to clear the tray or quit the app.
## Architecture
- **main.swift / AppDelegate**: Sets up a transparent `TriggerPanel` for hover/drag detection and a `TrayPanel` for the expanded UI.
- **LOGIC/TriggerHandler.swift** & **LOGIC/TrayHandler.swift**: Manages `NSTrackingArea` for hover and collapse logic.
- **LOGIC/TrayModel.swift**: `@MainActor` model storing `FileItem`s with O(1) duplicate checks and a background `sanityCheck` on `.utility` QoS.
- **LOGIC/FileItem.swift**: Represents a file/folder item, caches icons with `NSCache` and supports Swift concurrency.
- **GUI**: SwiftUI `Tray` view displaying items in a grid with smooth animations.
## Energy Impact
All event monitoring uses local `NSTrackingArea` and one-time offloaded `.utility` work queues, ensuring “Low” energy impact.