Change keyboard backlight with a keyboard shortcut on MacBook Pro using Automator, Shortcuts, or AppleScript

1.9k Views Asked by At

Apple has decided to remove keyboard backlight control keys from the keyboard on the new 2021 M1 MacBook Pros. I would like to reassign the keyboard backlight down/up functions to e.g. function keys F3 and F4.

I am unable to find a Terminal command to manipulate the keyboard backlight setting, or an Apple Shorcuts App's pre-built function to do this. The only way I have found to automatize this, is to use Automator's Watch Me Do function, where it literally manipulates the mouse cursor to click the control center, then then the Keyboard brightness button, and then sets the slider position. Manipulating mouse cursor is obviously less than ideal, and in practice does not really work: aside from having to grant accessibility permissions to every application, it also errors out, for some reason, even though the mouse cursor seems to complete its job.

So, is there a way to do this with a terminal command? Or perhaps you could point me to a file where the this setting is written, so I could try modifying the file with a script? Lastly, is there a way to re-assign the standard system control keys from e.g. F3's Exposé to something else?

Thanks in advance for your help!

1

There are 1 best solutions below

0
On BEST ANSWER

You can install Karabiner Elements online and reassign keys to different functions. There you can set whatever keys (in your case f3 &f4) to illumination down and up which will allow you to control backlit lights with function keys.

For exact procedure:

  1. install Karabiner (https://karabiner-elements.pqrs.org/)
  2. allow anything the app tolds you to do
  3. go to the "Function Keys" tab
  4. set the Target device to Apple Internal keyboard or any other keyboard you have
  5. on the function keys set "vk_consumer_illumination_down" for decrease and "vk_consumer_illumination_up" for increase brightness