A minimalist floating clock widget for macOS built with SwiftUI.
Mini Clock is a lightweight macOS application that displays the current time in a small, floating window that stays on top of other applications. Perfect for keeping track of time while working without cluttering your desktop.
- Floating Window: Always stays on top of other applications
- Borderless Design: Clean, minimal appearance with no window decorations
- Draggable: Click and drag to reposition anywhere on your screen
- Multi-Space Support: Appears on all desktop spaces and full-screen apps
- 24-Hour Format: Displays time in HH:mm format with leading zeros
- Real-time Updates: Updates every second automatically
- Monospaced Digits: Ensures consistent digit alignment
- Text Shadow: White text with black shadow for visibility on any background
- macOS 12.0 (Monterey) or later
- Xcode 14.0 or later (for building from source)
-
Clone this repository:
git clone https://github.com/yourusername/mini-clock.git cd mini-clock -
Open
mini-clock.xcodeprojin Xcode -
Build and run the project (⌘+R)
Download the latest release from the Releases page and run the .app file.
- Launch the application
- The clock window will appear floating on your screen
- Drag the window to reposition it anywhere you like
- The clock will automatically stay on top of other windows
- To quit, use ⌘+Q or quit from the menu bar
The app is designed to be minimal, but you can customize it by modifying the source code:
- Time Format: Change the
dateFormatinContentView.swift(line 16) - Font Size: Adjust the font size calculation in
ContentView.swift(line 30) - Colors: Modify text and shadow colors in
ContentView.swift(lines 34-35) - Window Size: Change the initial window dimensions in
mini_clockApp.swift(line 24)
- Built with SwiftUI and AppKit
- Uses
TimelineViewfor real-time updates - Implements custom
NSWindowmanagement for floating behavior - Window level set to
.floatingfor always-on-top functionality - Supports all Spaces and full-screen applications
mini-clock/
├── mini-clock/
│ ├── mini_clockApp.swift # Main app entry point and window management
│ ├── ContentView.swift # SwiftUI view for the clock display
│ └── Assets.xcassets/ # App icons and assets
└── mini-clock.xcodeproj/ # Xcode project file
- mini_clockApp.swift: Handles NSWindow creation and configuration
- ContentView.swift: SwiftUI view that displays the formatted time
- TimelineView: Provides automatic updates every second
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with SwiftUI and AppKit
- Inspired by the need for a simple, unobtrusive time display
If you encounter any issues or have suggestions for improvements, please open an issue on GitHub.