A macOS menu bar application that improves control over dark mode switching with custom time scheduling.
DarkModeSwitch solves a common macOS limitation: the system doesn't offers automatic dark/light mode switching, users cannot set custom times for when these switches occur. This lightweight menu bar app gives you full control over your appearance schedule.
- 🌙 Menu Bar Integration: Lives discretely in your menu bar
- ⚡ Quick Toggle: Instantly switch between dark and light modes with a click or keyboard shortcut (⌘⇧A)
- ⏰ Custom Scheduling: Set your own times for automatic dark/light mode switching
- macOS 10.15 (Catalina) or later
- Download the latest release from the Releases page
- Move
DarkModeSwitch.appto your Applications folder - Launch the app - you'll see the icon appear in your menu bar
- Grant the necessary permissions when prompted
-
Clone the repository:
git clone https://github.com/MatejkoB/DarkModeSwitch.git cd DarkModeSwitch -
Open the project in Xcode:
open DarkModeSwitch.xcodeproj
-
Build and run the app (⌘R) or build from command line:
xcodebuild -project DarkModeSwitch.xcodeproj -scheme App -configuration Release build
- Click the menu bar icon to reveal the menu
- Select "Toggle Appearance" or use the keyboard shortcut ⌘⇧A
- The system appearance will switch immediately
- Click the menu bar icon and select "Settings..."
- Enable "Automatic switching"
- Set your preferred times:
- Dark mode time: When to switch to dark mode
- Light mode time: When to switch to light mode
- The app will automatically switch modes at the specified times
DarkModeSwitch is built with modern Swift and SwiftUI, following clean architecture principles:
- Modular Design: Core functionality is separated into Swift packages
- MVVM Pattern: Clear separation between views and business logic
- Comprehensive Testing: Includes unit tests with spy objects for all major components
# Debug build
xcodebuild -project DarkModeSwitch.xcodeproj -scheme App -configuration Debug build
# Run tests
xcodebuild -project DarkModeSwitch.xcodeproj -scheme Tests testDarkModeSwitch/
├── Sources/ # Main application code
│ ├── Features/ # Feature modules (DarkMode, MenuBar, Scheduling, Settings)
│ └── Core/ # Shared models and utilities
├── LaunchAgent/ # Background scheduler for automatic switching
├── Packages/ # Local Swift packages
│ ├── AppearanceSwitcher/ # Core appearance switching logic
│ └── Utilities/ # Shared utilities and preferences
└── Tests/ # Test suite with spies and mocks
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
See CODE_OF_CONDUCT.md for our code of conduct.
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have suggestions, please open an issue on GitHub.
Made with ❤️ by Mateusz Bąk