13 ms·
Lunar – macOS utility to set brightness and volume on external monitors
- alin23 6y agoCreator of Lunar here. Thank you all for the kind comments and generous donations and many thanks to the OP for posting this! Let me know if you have any questions or quick feedback about Lunar.
- diimdeep 6y agoReally well done. AFAIK there is no events for brightness change so this is why polling for main monitor brightness? What are you using for analytics at "https://log.lunar.fyi https://log.lunar.fyi? I have been using [1] before, your app seems much more slick [1]: https://github.com/KAMIKAZEUA/NativeDisplayBrightness https://github.com/KAMIKAZEUA/NativeDisplayBrightness
- alin23 6y agoThanks! Yes, there are no brightness change events, but reading the brightness is very fast so polling adds very little overhead. For analytics I've just been using a plain nginx route that logs the request body to a static file, and I parse that using loki for further visualization in Grafana. I haven't found much value in that info though so I've decommissioned it after I migrated from nginx to Caddy. I'll remove the analytics request in the next update.
- inspector-g 6y agoThanks for writing this! When I got an iMac Pro in 2017 with an accompanying LG UltraFine 5K display I was shocked to learn three things: 1) adjusting the brightness on the internal display is easy but on the LG it's a pain in the ass, 2) despite having ambient light sensor hardware the LG does not automatically adjust its brightness like the internal display, and 3) macOS offers no built-in mechanism to sync the brightnesses of these two displays. Before learning these things I was feeling excited about Apple's re-committing to the Mac around that time, but man these things made it feel like such "commitment" was just surface level - such low-hanging fruit not being handled is a shame. But, this is a rant for another day. Anyway, I built my own very simple utility to poll the internal display for its brightness and write that same brightness to the LG via DDC, but never had the time/energy to make it more robust for publishing to the web. I have yet to try Lunar but I definitely will; much appreciated.
- dmitshur 6y ago> adjusting the brightness on the internal display is easy but on the LG it's a pain in the ass Can you elaborate on why you think that is? I’ve owned that monitor, and it seemed equally easy on both.
- simmielol123 6y agoVery nice app! It was very tedious to do it manually on the monitor!
- myowz 6y agoQuick feedback: I tried it for the first time, thinking to myself 'wow I really want to turn down the brightness on this darn monitor...its been bothering me for too long' and I didn't find the UX very easy to perform that immediate task. In fact, I have to say, just from quickly downloading this and trying to use it, I don't totally understand what it does...but I did figure out how to manually drop the settings to a more comfortable level, and I don't expect I'll be opening the software again except to manually turn it up and down (and each time I'll probably have to figure out how to go to that side page that is hard to get to) Hope that made sense! Thanks for the software!!! :)
- alin23 6y agoHey thanks for the feedback! I know the UI is a bit too complex at the moment. It's hard to strike a balance between simplicity and configurability. It's still a work in progress. So what does this do: Lunar allows you to change the hardware brightness and contrast of the monitor (the one that can be controlled with the hardware buttons on the monitor) If you simply want to turn down the brightness from time to time, you can set Lunar in Manual mode and use the brightness keys on your keyboard to adjust the monitor brightness. Where Lunar shines is with a MacBook or iMac where there is an ambient light sensor integrated in the device that adapts the builtin display brightness. In Sync mode Lunar can sync that already adapted brightness to your external monitor so you don't have to worry about the brightness throughout the day. There's also a Location mode if you want the brightness to adjust automatically based on the sun position in your location. All this can be controlled through hotkeys which are visible in both the menu bar icon menu and the Hotkeys configuration page reachable by pressing the left arrow key 2 times in the Lunar UI.
- jcz_nz 6y agoSame thing. I found MonitorControl as a result, and found it a lot... fit for purpose.
- bgentry 6y agoHi there, I couldn't find a way to disable built-in logging & analytics to log.lunar.fyi. Is there a setting to disable any network requests other than for software updates? Thanks!
- alin23 6y agoHi! The route for log.lunar.fyi just returns 200 now and doesn't do anything. I was just logging the request before but I disabled that in the meantime since I didn't find it useful. I will disable the request completely in the next update, but if you want to know what's sent or even disable it completely you can take a look at the source code of the sendAnalytics function in AppDelegate.swift: https://github.com/alin23/Lunar https://github.com/alin23/Lunar
- stevewillows 6y agoI've been using your app for a while now. I love it. It's worked flawlessly from the get-go, too. Thanks for making this! Having keys to adjust the brightness is such a blessing for my workflow.
- car 6y agoThank you for making Lunar! Your app has been a godsend for my multimonitor setup, Macbook in clamshell mode. I tried a bunch of tools, but eventually gave up frustrated after crashes. Love Lunar since I discovered it, it’s been working smooth from day one.
- nuclearghost 6y agoThis also saved my multi-monitor set up. Thanks so much!!
- arvindch 6y agoAbsolutely amazing application - I found it on HN sometime at the beginning of COVID lockdowns, and it has radically changed my WFH life. Thank you so much :D I use it with 2 disparate non-thunderbolt monitors, one connected into its built-in dock, and the other to a dock dongle. Works perfectly fine!
- zgn 6y agoAs someone who is sensitive to bright screens, lunar is something I use everyday. Thank you!!
- mmastrac 6y agoAlso note that MonitorControl [1] might be a good complement to this program - it allows manual setting of brightness and contrast, but also adds volume control. [1] https://github.com/MonitorControl/MonitorControl https://github.com/MonitorControl/MonitorControl
- cvburgess 6y agoSecond that, I use MonitorControl and it has made adjusting volume and brightness... how it should be.
- car 6y agoLunar also has volume control, could not fit that into the title. It's absolutely great, totally what I needed for years. Other tools I tried crashed my Macbook. Lunar has been absolutely smooth, and great design to boot. I immediately bought the author a coffee. Edit: updated the title
- inickt 6y agoOh man I’ve been looking for something to control volume like this forever. Doing audio over DisplayPort/HDMI locks me out of controlling volume (since it’s handled by the monitor) so I’m really hoping this helps with that.
- NegativeLatency 6y agoMy experience has been that my monitor has limited volume control capability (compared to the knob on my external speakers, which are plugged into the monitor). It's nice for mute/unmute though
- wlesieutre 6y agoNeat! I just got a new screen with DDC/CI and was excited to get that control with Dell Display Manager on my desktop rather than digging through OSD menus. I wish it would just go in the action center like a laptop's built-in screen, but it's still more convenient than using the buttons. Will have to try this out when I get it hooked up to my Macbook!
- gardaani 6y agoI have been using this command line tool to control my external monitor from my Mac. I created few Automator scripts calling it to make the monitor either dimmed or bright. https://github.com/kfix/ddcctl https://github.com/kfix/ddcctl
- blacksmith_tb 6y agoSecond that, I have it bound to a couple of fn keys via Karabiner to turn my old Dell monitor to its dimmest and brightest settings.
- t3rabytes 6y agoI didn't expect my 5 year old Dell P2415Q to Just Work with Lunar, but it does, awesome! Now to stop messing with that awful OSD.
- applecrazy 6y agoThank you for making this! I used to have to unplug my external monitors and use only my laptop screen at night because they used to be so bright. Always wanted something like this.
- snowwrestler 6y agoThis is a great example of why I like the Touch Bar on my Macbook Pro. When it is connected to an external monitor, I tap the brightness icon in the Touch Bar and get two sliders: one to control brightness on my laptop, and one to control brightness on my external monitor. This seems to be a native feature; I did not install anything to do it.
- harikb 6y agoIs this a particular brand of external monitor? Lunar works for me, but my external monitor is not integrated with touchbar!
- NegativeLatency 6y agoI think it's a little bit like CEC where there isn't just one standard and some implementations have weird quirks. https://en.wikipedia.org/wiki/Display_Data_Channel https://en.wikipedia.org/wiki/Display_Data_Channel
- snowwrestler 6y agoMine is an old Apple Thunderbolt 27" external display. It didn't occur to me that the Touch Bar control might be specific to this display, since the display predates the TouchBar by many years. But maybe it is, since you and other commenters don't seem to see it.
- bllguo 6y agoBut why can't they expose these controls independent of the Touch Bar? I actually find it ridiculous as a 2015 MBP owner that there is no easy native way to do this basic thing unless, apparently, you have a Macbook with a Touch Bar
- NegativeLatency 6y agoThe apple thunderbolt displays have some keyboard shortcuts IIRC, but that has its own host of problems
- 6y ago
- nsxwolf 6y agoWhy is this needed in the first place? I was shocked when I could no longer control brightness after upgrading from my old 23" Apple Cinema Display.
- deleted 6y ago[deleted]
- cr3ative 6y agoNeat. I have two external monitors which behave very differently though - please make the clipping setting per-monitor rather than global!
- car 6y ago> please make the clipping setting per-monitor rather than global! You could open a feature request on GitHub, best way to let author know. https://github.com/alin23/Lunar/issues/new?assignees=alin23&labels=features&template=lunar-feature.md&title=Lunar+Feature https://github.com/alin23/Lunar/issues/new?assignees=alin23&...
- alin23 6y agoI guess it makes sense to have that setting per monitor. I just have to rethink the monitor settings UI because it seems I can't fit anything else in there. I already have a lot of users telling me that the UI is too complex.
- wanghq 6y agoGot a MacBook Pro (16-inch, 2019) weeks ago and bought a LG monitor (https://www.amazon.com/gp/product/B07YGZ7C1K https://www.amazon.com/gp/product/B07YGZ7C1K). The brightness setting bothered me for 2 weeks as neither the Mac OSX nor LG's onscreen control software can set the brightness for the external monitor. The external monitor brightness changes every time I open/close the macbook lid. Thanks to both ddcctl and MonitorControl, I can finally set a fixed brightness. Wondering why big corps fail to provide the basic features while some open source software can do?
- BillinghamJ 6y agoThe LG UltraFine displays do support this (in fact there's no OSD/controls on the physical things at all) so it definitely is possible and something LG can do
- willseth 6y agoAutomatic dimming only works in the recently refreshed (mid 2019) UltraFines. It doesn't work in the original models sold from 2016-2019, despite advertising and product documentation claims that it does.
- dapids 6y agoI have the exact same setup and same issues!! So frustrating.
- JamesBrooks 6y ago
- herf 6y agoThere is a problem with "cheap" monitors and DDC/CI: some of them use EEPROMs to store brightness settings, and this limits you to about 100,000 writes. Worrying about this is the main reason we don't ship DDC/CI with f.lux. (I know that some more modern monitors use NAND and don't have limitations like this.) Anyone know if these fears are overblown?
- diimdeep 6y agoThis is hilarious if this is true.
- leokennis 6y agoWait...so after the 100.000th write, your monitor will be forever stuck on the brightness it was set to that time? BTW, assuming I change brightness 20 times per day, that would still give me 5000 days ≈ 13,5 years of service. By that time I definitely hope to use a different monitor than today
- arghwhat 6y agoNo, after 100.000th write your monitor is toast because the EEPROM died. Also note that most people change brightness in increments, with each step causing a write.
- taeric 6y agoIs there a way to know how my monitor does this?
- EricE 6y agoI'd like to know this too!
- PascLeRasc 6y agoI've been reading that NAND flash doesn't support erasing individual bytes, while EEPROM does. If there's some way to attempt this and know the outcome, maybe that's a way to figure it out.
- jasim 6y agoAlongwith ddctrl (https://github.com/kfix/ddcctl https://github.com/kfix/ddcctl), these aliases serve all my external monitor brightness needs: alias verydull="~/Software/ddcctl/ddcctl -d 1 -b 3 -c 15" alias dull="~/Software/ddcctl/ddcctl -d 1 -b 6 -c 35" alias decent="~/Software/ddcctl/ddcctl -d 1 -b 10 -c 40" alias medium="~/Software/ddcctl/ddcctl -d 1 -b 25 -c 50" alias bright="~/Software/ddcctl/ddcctl -d 1 -b 30 -c 50" alias morebright="~/Software/ddcctl/ddcctl -d 1 -b 35 -c 60" alias superbright="~/Software/ddcctl/ddcctl -d 1 -b 100 -c 80"
- powersnail 6y agoFor Linux, use ddcutil. I wrote a GUI slider that wraps around the command line, so I don't have to type the numbers each time.
- MayeulC 6y agoWell, there's also ddccontrol: https://github.com/ddccontrol/ddccontrol https://github.com/ddccontrol/ddccontrol that has an optional GUI. I think that's the one I've used in the past. Pretty much all monitor settings are exposed.
- bshep 6y agoI made an app to wrap around ddcctl that works on osx, it works fine for my own uses and if anyone want to improve it feels free. https://github.com/bshep/ASUS-DDC-Volume https://github.com/bshep/ASUS-DDC-Volume
- gutnor 6y agoI combine this with https://github.com/nriley/brightness https://github.com/nriley/brightness to retrieve the brightness of the main screen, then I use ddcctl to apply it to the external screen. I set it up in a cron job and that has been running for years now. (the external monitor brightness is not very linear though, so you need to fiddle a big to find the proper/acceptable matching)
- car 6y agoI've been using this every day for a couple of months. My monitors are a Dell P2715Q and LG 32UD59-B. The only issue was with the "Read external monitor brightness periodically" preference, which froze the system. But there is a fair warning. If you feel like supporting the author, here is his Patreon: https://www.patreon.com/alinpanaitiu https://www.patreon.com/alinpanaitiu
- car 6y agoI should add that both monitors are connected via DisplayPort. Also, I found that cheap DP cables can really mess things up. Eventually I found via the VESA website which manufacturers have their cables certified. My go to is called Accell, very solid ever since using their cables. https://vesa.org/displayport-developer/certified-components/ https://vesa.org/displayport-developer/certified-components/
- alin23 6y agoHey thank you so much for posting this! I didn't expect this to get so much attention. Also that VESA page is golden, now I know where to point people when they ask me for advice on what peripherals to buy.
- car 6y agoHey, glad it took off and got you and Lunar some exposure. I’m grateful for it being available free and solving a rather large annoyance. You are obviously very talented, keep up the good work!
- rakibtg 6y agoThanks <3
- flurdy 6y agoHow does this compare to a blue light adjuster like the built in macOS one or f.lux [1]? I think they would complement each other. Anyone tried both? (Lunar and f.lux) * [1] https://justgetflux.com/ https://justgetflux.com/
- alin23 6y agoLunar should work just fine with f.lux as it only changes the monitor hardware brightness. Color processing from f.lux can still be applied on top of that without any issues. I've been using Lunar with Night Shift ever since it was released in macOS and they complement each other very well at night.
- ereinertsen 6y agoHas anyone been able to map volume control to their volume control knob?
- throw14082020 6y agoI regret installing this, as I cannot undo the brightness changes, even when I quit the app. How do i do this lol
- cloudmaster 6y agoThe Windows equivalent would be Monitorian (https://github.com/emoacht/Monitorian https://github.com/emoacht/Monitorian). It doesn't have the adaptive curve algorithm, but I've been using it for over a year and it's indispensable.
- rrrrrrrrrrrryan 6y agoTwinkle Tray has a few more features (like a scheduler), and is also FOSS. https://github.com/xanderfrangos/twinkle-tray https://github.com/xanderfrangos/twinkle-tray
- pi-rat 6y agoFrickin' brilliant, thank you! Worked with my LG display out of the box. Enjoy your coffee :D
- rosstex 6y agoI just tried Lunar out, it definitely makes the brightness on the external monitor higher than the Laptop monitor. How bright is too bright?
- car 6y agoI think you can bracket the brightness in Lunar for each monitor, i.e. max 70%.
- atombender 6y agoOff topic but tangentially related: Is there a brightness tool for the iPhone that has a better colour profile that harmonizes "dark mode" and "light mode"? On my iPhone 11 late at night, turning the brightness down to 20% makes black text on white readable, but if I switch to a dark mode app, it's not comfortable, so I have to turn the brightness up again. To me, that implies the brightness just linearly applies to the whole colour spectrum, when it'd be better to weight the brightness logarithmically: Colours close to the dark should stay the same at both 20% and 100% brightness. I'm not sure if this is even possible on an iPhone. I don't have the same problem on my external Dell screen with my Mac, not sure why.
- ollysb 6y agoDon't know if it's specific to LG monitors but the brightness controls on my keyboard modify the screen of whichever window has focus.
- car 6y agoFor me when pressing the Mac brightness keys Lunar changes the monitor where the mouse is located.
- dublin 6y agoI'd settle for the Mac being smart enough to let me resize each external display to its actual physical size, so dragging between them works. Apparently, Apple thinks it's perfectly OK to assume that all your displays have the same pixel density as your laptop screen - FAIL!
- andy_ppp 6y agoI seem to be able to set scaling on both of my monitors separately... so not sure what you mean. Actually I think on the external display there might be a keyboard shortcut to set common resolution equivalents for the scaling even on lower dpi screens.
- matchbok 6y agoCool idea, but I'm a software developer and I cannot figure out how to use this app. Something as simple as monitor brightness doesn't need so many controls, toggles, and things popping up and telling me things. It doesn't follow a single MacOS design convention.
- alin23 6y agoDifferent users have different needs. The app was extremely simple when I first launched it because I only needed an UI for ddcctl. But as I was gathering feedback from users, I wanted to make Lunar usable in as many monitor setups as possible. And very good ideas came out of that (Sync mode being one of them) but it also cluttered the UI with a bit too many configurable values. Those are still needed by some users even though they might not seem useful for you, so I don't want to remove configurability. I think by adding all these knobs, Lunar achieved the goal of being flexible enough to conform to most types of monitor usage. Now I just have to figure out how to simplify all this without losing flexibility.
- darren 6y agoI'm not sure why you're being downvoted but I really struggled with this application as well. Sync mode? location mode? There's help text, which I read it several times and I still have no idea what's going on. The preferences screen is very difficult to use - it's a mix of labels and buttons with no indication that things are adjustable. You can adjust the brightness by hovering over the brightness amount and scrolling vertically. There are multiple preference panes, but they're only findable with horizontal scrolling. None of this is easily discoverable. I use the software... but pretty much only the shortcut keys (^F2, ^F1). The other features which seem like they could be useful, would probably see a lot higher adoption if the application followed some UX best practices.
- mjcohen 6y agoDoesn't work on 2014 Mac Mini running High sierra. Does nothing and goes away.
- alin23 6y agoI think High Sierra doesn't have the Swift 5 libraries. You might need to install them from the Apple website first: https://support.apple.com/kb/DL1998?locale=en_US https://support.apple.com/kb/DL1998?locale=en_US I have that information in the troubleshooting section on Github but I'll have to update the official website to also include that.
- kposehn 6y agoThanks for making this. Light years better than the original app I was using as it lets me change the volume stepper control, though the scroll/swipe motions in settings are bit jarring to use.
- alin23 6y agoI'm glad you find it useful! Up/down arrow keys can also be used to adjust values in the UI while the cursor is on a value. I mostly use scrolling for rough adjustments and arrow keys for fine tuning. It feels faster than simply editing a text field. Although I'm planning to make the fields editable in the future as a lot of users have requested that.
- grishka 6y agoI've tried some of these a while ago. It locked up my entire system requiring a hard reset every time it tried to send a command to the monitor.
- alin23 6y agoThis is usually a hardware problem. I haven't found an easy way to detect if a GPU+monitor combination will have a very slow response time for DDC messages so all I can do in Lunar is send the messages to the monitor and if a number of messages fail then Lunar stops sending them to keep the system usable. But there are cases like yours where the response time is so slow that the kernel panics in the first DDC message and freezes the whole system. There's no way to detect or recover from that in software.
- ProfessorLayton 6y agoI can't believe this works on my 11yo Dell monitor connected via Thunderbolt> Dock> Displayport. Thank you! I haven't messed with the brightness in years because the OSD is so bad. I would honestly base my next monitor purchase based on compatibility with this utility!
- jordache 6y agovolume control doesn't work
- alin23 6y agoUnfortunately not all monitors support volume control through DDC.
- Syzygies 6y agoI've been using ExternalDisplayBrightness for this: https://www.nesveda.com/projects/ExternalDisplayBrightness/ https://www.nesveda.com/projects/ExternalDisplayBrightness/ With my LG 32UL950-W, I've found that whether it responds depends on the cable choice. I had to give up on Thunderbolt because the monitor itself kept resetting; HDMI delivers a picture but doesn't look as good, and doesn't respond to ExternalDisplayBrightness. I'm now using a 10' USB-C to DisplayPort cable (too long for Thunderbolt) and everything works, including ExternalDisplayBrightness. I'm curious to see if switching to Lunar would gain me anything.
- allengeorge 6y agoI was unable to figure out how to get this to work with an iMac as a secondary display :( Looked wonderful though!
- barkingcat 6y agoThis is pretty useful!
- toasterrepair 6y agoLove the utility! Been using it for a few months now. I’m curious, but is it possible to have the tool change inputs as well? For example, to change from DisplayPort to hdmi, and back from a keystroke.
- alin23 6y agoOnly part of that is possible, changing from the current input to another. But as soon as the monitor is on another input it doesn't accept DDC messages on the first input anymore so Lunar wouldn't also be able to change back. I plan to implement just the first switch along with a brightness/contrast reset to some default values so you can easily switch the monitor to another input.
- car 6y agoThis rather clever cheap hardware and software KVM project is solving the issue in an interesting way, maybe a cross-polination opportunity? https://haim.dev/posts/2020-07-28-dual-monitor-kvm/ https://haim.dev/posts/2020-07-28-dual-monitor-kvm/
- kylemh 6y agoyes! the volume control is huge for me
- markestefanos 6y agoThis is the only solution I've tried that works with the two identical monitors I use. Thanks for making it!
- matthewhartmans 6y agoSuper cool OP! Well done! :)
- vkoskiv 6y agoWhat a nice little tool! I have two random no-name adapters at work for my two monitors. One is DisplayPort, and the other HDMI. I wasn't expecting this to work, but sure enough, it does! Both monitors show up and promptly respond to my brightness settings.
- benguild 6y agoAll I want is that 50% idle timer that the laptops do.
- neal_jones 6y agoBeen using MonitorControl for a while now, and it was great but this is far nicer in my opinion. Great work. The only downside is before I saw this discussion I was happily using MonitorControl and now I'm using Lunar scared to death that one day both of my expensive 4k monitors will just be bricked due to the whole DDC/CI/EEPROM 100,000 writes deal discussed by @herf
- alin23 6y agoI have an LG Ultra HD monitor and I have been using Lunar with smooth transition for 2 years now. I have far exceeded the 100k writes mark, probably even more than 500k and I see no problem with my monitor. I think new monitors should be immune to this since RAM and flash storage is so much cheaper nowadays.
- pwinnski 6y ago`brew cask install lunar` works, so into my MacOS init script (laptop.local) it goes!