Top Related Projects
A tiling window manager for macOS based on binary space partitioning
Automatic tiling window manager for macOS à la xmonad.
Move and resize windows on macOS with keyboard shortcuts and snap areas
Managing windows size and position in OSX
A lightweight macOS window and app manager scriptable with JavaScript
Quick Overview
Lunar is an open-source macOS application that allows users to control the brightness and contrast of external displays. It provides a seamless way to adjust monitor settings, especially for displays that don't have physical buttons or those that are not directly supported by macOS.
Pros
- Supports a wide range of external displays, including those not natively recognized by macOS
- Offers automatic brightness adjustment based on the built-in ambient light sensor
- Provides a clean and intuitive user interface
- Includes advanced features like custom DDC protocols and keyboard shortcuts
Cons
- Limited to macOS, not available for other operating systems
- May require additional setup for some displays
- Potential compatibility issues with certain monitor models
- Relies on DDC/CI, which might not be supported by all displays
Getting Started
- Download the latest release from the Lunar GitHub releases page.
- Open the downloaded DMG file and drag the Lunar app to your Applications folder.
- Launch Lunar from your Applications folder.
- Grant the necessary permissions when prompted (accessibility and screen recording).
- Use the menu bar icon or keyboard shortcuts to adjust your external display's brightness and contrast.
For more detailed instructions and advanced configuration options, refer to the Lunar documentation.
Competitor Comparisons
A tiling window manager for macOS based on binary space partitioning
Pros of yabai
- More comprehensive window management system with tiling and stacking capabilities
- Highly customizable with extensive configuration options
- Supports scripting and integration with other tools like skhd for hotkey management
Cons of yabai
- Steeper learning curve due to its complexity and extensive features
- Requires disabling System Integrity Protection (SIP) for full functionality
- May have higher resource usage compared to simpler alternatives
Code Comparison
Lunar (configuration example):
let config = LunarConfig()
config.brightness = 50
config.temperature = 4500
Lunar.shared.apply(config)
yabai (configuration example):
yabai -m config layout bsp
yabai -m config top_padding 10
yabai -m config left_padding 10
yabai -m config right_padding 10
yabai -m config bottom_padding 10
Key Differences
- Lunar focuses on display brightness and color temperature management, while yabai is a full-fledged window manager
- Lunar provides a simpler, more user-friendly interface for adjusting display settings
- yabai offers more advanced features for power users who want granular control over window layouts and positioning
Use Cases
- Lunar: Ideal for users who primarily want to manage display brightness and color temperature based on time or location
- yabai: Better suited for users who desire a tiling window manager with extensive customization options and advanced window control
Automatic tiling window manager for macOS à la xmonad.
Pros of Amethyst
- Open-source and free to use
- More mature project with a larger community and longer development history
- Supports complex window management layouts and configurations
Cons of Amethyst
- Limited to macOS only
- Less user-friendly interface for non-technical users
- Fewer display and monitor-specific features compared to Lunar
Code Comparison
Amethyst (Swift):
func cycleLayoutForward() {
let oldLayoutIndex = currentLayoutIndex
currentLayoutIndex = (currentLayoutIndex + 1) % layouts.count
setLayout(layouts[currentLayoutIndex], withLayout: layouts[oldLayoutIndex])
}
Lunar (Python):
def set_brightness(self, brightness):
self.brightness = brightness
self.apply_brightness()
self.save_brightness()
While both projects focus on window management and display control, their implementations differ significantly. Amethyst uses Swift and focuses on window tiling and layout management, while Lunar is written in Python and emphasizes display brightness and color temperature control. Amethyst's code sample shows layout cycling functionality, whereas Lunar's code demonstrates brightness adjustment and persistence.
Move and resize windows on macOS with keyboard shortcuts and snap areas
Pros of Rectangle
- Open-source and free to use
- Lightweight and efficient window management
- Supports keyboard shortcuts for quick window positioning
Cons of Rectangle
- Limited to window management functionality
- Less customization options for display settings
- No built-in support for external display brightness control
Code Comparison
Rectangle (Swift):
func moveWindowToCenter() {
if let screen = NSScreen.main {
let visibleFrame = screen.visibleFrame
let newFrame = NSRect(x: visibleFrame.midX - frame.width / 2,
y: visibleFrame.midY - frame.height / 2,
width: frame.width,
height: frame.height)
setFrame(newFrame, display: true)
}
}
Lunar (Swift):
func adjustBrightness(for display: Display, to value: Double) {
guard let service = display.service else { return }
let brightness = max(0, min(1, value))
IODisplaySetFloatParameter(service, 0, kIODisplayBrightnessKey, Float32(brightness))
IODisplaySetFloatParameter(service, 0, kIODisplayLinearBrightnessKey, Float32(brightness))
}
The code snippets highlight the different focus areas of the two projects. Rectangle concentrates on window management, while Lunar emphasizes display brightness control and management.
Managing windows size and position in OSX
Pros of ShiftIt
- Open-source and free to use
- Lightweight and simple window management tool
- Supports custom keyboard shortcuts for window positioning
Cons of ShiftIt
- Less feature-rich compared to Lunar
- Not actively maintained (last commit in 2016)
- Limited to window management functionality only
Code Comparison
ShiftIt (Objective-C):
- (void)moveToLeftHalf {
SIFrame frame = SIMakeFrame(0, 0, 0.5, 1);
[self moveAndResize:frame];
}
Lunar (Swift):
func setBrightness(_ brightness: Int, for display: Display) {
display.setBrightness(brightness)
updateMenus()
}
Key Differences
- ShiftIt focuses solely on window management, while Lunar is primarily a display brightness and color temperature control tool
- Lunar offers more advanced features like adaptive brightness and multi-monitor support
- ShiftIt is written in Objective-C, whereas Lunar is developed using Swift
- Lunar has more recent development activity and regular updates
Conclusion
ShiftIt is a simple, focused window management tool, while Lunar provides comprehensive display control features. Users looking for basic window management might prefer ShiftIt's simplicity, but those seeking advanced display control and active development should consider Lunar.
A lightweight macOS window and app manager scriptable with JavaScript
Pros of Phoenix
- Built with Elixir, offering excellent concurrency and fault tolerance
- Designed for building scalable web applications and APIs
- Strong focus on productivity and developer experience
Cons of Phoenix
- Steeper learning curve for developers unfamiliar with Elixir
- Smaller ecosystem compared to more mainstream web frameworks
- May be overkill for simple applications or small projects
Code Comparison
Phoenix (Router):
scope "/", MyApp do
pipe_through :browser
get "/", PageController, :index
resources "/users", UserController
end
Lunar (Configuration):
config = {
'displays': [
{'name': 'Built-in Display', 'id': 'main'},
{'name': 'External Display', 'id': 'external'}
],
'brightness': {
'default': 50,
'min': 0,
'max': 100
}
}
Summary
Phoenix is a robust web framework for building scalable applications, while Lunar is a macOS utility for adjusting display brightness. They serve different purposes and are not directly comparable in terms of functionality. Phoenix excels in web development, offering powerful features for building complex applications, but may have a steeper learning curve. Lunar, on the other hand, focuses on a specific desktop utility function and is likely easier to set up and use for its intended purpose.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Lunar
The defacto app for controlling monitors
Adjust brightness, change volume, switch inputs
macOS app for controlling monitors, with native support for both Intel and Apple Silicon
Community
DDC/CI
Lunar changes the hardware brightness of the monitor using the DDC protocol.
It doesn't use a software overlay if the monitor supports DDC/CI.
Installation methods
Features
- Native keyboard control and hotkeys for setting brightness, volume and contrast that respect the min/max values per monitor
- 1000-to-1600 nits of brightness for supported XDR and HDR displays
- Dim brightness below 0% for late-night work
- Sensor-based Adaptive Brightness (and contrast) based on an external light sensor
- Sync-based Adaptive Brightness (and contrast) based on the built-in light sensor of the MacBook or iMac
- Location-based Adaptive Brightness (and contrast) based on the sunrise/sunset times in your location
- App Presets if you need more/less brightness for specific activities (watching movies, design work)
- Input switching from a convenient dropdown or using up to 3 input-specific hotkeys
- Screen orientation change from the menu bar or using hotkeys (Ctrl+0/9/8/7 mapped to 0°/90°/180°/270° for the display with the cursor on it)
- Hidden resolutions accessible from a dropdown in the Display Settings menu
- BlackOut: turn off monitors (or the built-in display) selectively while also keeping important functions:
- USB-C charging still works
- Monitor audio keeps playing
- Monitor USB hub remains available
- The built-in keyboard and trackpad are still available for use
- Avoid overheating the MacBook because of using it with the lid closed
It doesn't interfere at all with the native adaptive brightness that macOS implements for the built-in display.
It works well along Night Shift and True Tone (and f.lux if Gamma dimming is not used).
QuickActions Menu
Display Page
Display Settings
Built-in Display Page
Display Input Hotkeys
Configuration Page
Hotkeys Page
Tested and known to work with the following types of connections
- HDMI (1.0 - 2.1)
- DisplayPort (1.0 - 2.0)
- Thunderbolt 4 (USB Type-C)
- Thunderbolt 3 (USB Type-C)
- Thunderbolt 2 (mini DisplayPort)
- VGA
- DVI
- Adapters that forward DDC messages properly
Contributing
I'm pausing contributions for the moment as Lunar has paid features and isn't compilable because of missing parts of the source code (Pro features code is encrypted).
Building
Lunar can't be built from this repo as the source code for the paid features is hidden.
Top Related Projects
A tiling window manager for macOS based on binary space partitioning
Automatic tiling window manager for macOS à la xmonad.
Move and resize windows on macOS with keyboard shortcuts and snap areas
Managing windows size and position in OSX
A lightweight macOS window and app manager scriptable with JavaScript
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot