Possible to Configure Caps Lock LED Manipulation Similar to Karabiner?

Hello BetterTouchTool community,

I’m exploring whether it’s possible to configure something like the "Manipulate Caps Lock LED" functionality offered by Karabiner within BetterTouchTool.

Currently, I’m using the setledsmac application from DamienG's GitHub repository to control the Caps Lock LED indicator on my keyboard. While this works, I’ve noticed a significant delay because it spawns a terminal process for each LED state change (on/off) and then kills the process afterward.

To reduce this delay, I’ve been experimenting with the Apple JavaScript for Automation (JAX) action. My current script looks like this:

(async () => {
    const app = Application.currentApplication();
    app.includeStandardAdditions = true;

    const shellCommand = "/opt/setleds/setleds ^caps -name 'Surface Type Cover’”;

    const exec = app.doShellScript(shellCommand);

    return exec;
})();

Although this approach seems slightly faster, there’s still a noticeable lag due to the overhead of creating shell processes.

My question is:

  • Is there any way within BetterTouchTool to achieve real-time or near-real-time control over the Caps Lock LED indicator?
  • Can BetterTouchTool directly manipulate the LED state without spawning external processes, or integrate with tools like setledsmac in a more efficient way?

Any insights, workarounds, or suggestions would be greatly appreciated!

Thanks in advance for your help!