This Hammerspoon script fixes the buzzing issue on external displays when waking up from sleep. The script saves the current brightness of the external display when the screens go to sleep and restores the brightness after the screens wake up.
- Hammerspoon
- m1ddc (for M1 Macs)
-
Install Hammerspoon if you haven't already.
-
Install m1ddc using Homebrew:
brew install --cask m1ddc
-
Clone this repository or copy the
external_display_buzzing_fix.lua
script to your Hammerspoon configuration directory (usually~/.hammerspoon/
). -
Edit your Hammerspoon
init.lua
file (located in the Hammerspoon configuration directory) and add the following line to load the script:
require("external_display_buzzing_fix")
- Reload your Hammerspoon configuration by clicking the Hammerspoon menu bar icon and selecting "Reload Config".
The script runs automatically when the screens go to sleep and wake up. No manual intervention is required.
This project is licensed under the MIT License. See the LICENSE file for details.