damieng / setledsmac

Set your keyboard LEDs from the Mac OS X command-line
GNU General Public License v2.0
140 stars 35 forks source link

Karabiner + setledsmac #17

Closed wallneradam closed 1 month ago

wallneradam commented 2 years ago

I read the issue #7, and found a workaround to that.

There were an answer suggesting to kill Karabiner then restart it (https://github.com/damieng/setledsmac/issues/7#issuecomment-375844299) . I found that you can disable a device in Karabiner without killing it, under Devices tab. After that you can simply use setledsmac, then you can turn tis settings back immediately.

Also found that, this is easily scriptable, because you can change this setting in ~/.config/karabiner/karabiner.json . You can iterate /profiles/devices and check ./identifiers/product_id/vendor_id to find the device settings. If you found that, you can set ./ignore to true, use setleds, then set back to false. The file is processed by Karabiner automatically, no need to run any command.

I think this could be part of setledsmac, because Karabiner is essential to make numlock function works on external keyboars.

damieng commented 2 years ago

I'd be open to a pull request but given I haven't even powered on a Mac in months it's definitely not something I would tackle myself these days.

superkeyor commented 1 year ago

I read the issue #7, and found a workaround to that.

There were an answer suggesting to kill Karabiner then restart it (#7 (comment)) . I found that you can disable a device in Karabiner without killing it, under Devices tab. After that you can simply use setledsmac, then you can turn tis settings back immediately.

Also found that, this is easily scriptable, because you can change this setting in ~/.config/karabiner/karabiner.json . You can iterate /profiles/devices and check ./identifiers/product_id/vendor_id to find the device settings. If you found that, you can set ./ignore to true, use setleds, then set back to false. The file is processed by Karabiner automatically, no need to run any command.

I think this could be part of setledsmac, because Karabiner is essential to make numlock function works on external keyboars.

I found that Karabiner allows to switch profile from command line. So you can create a new profile without selecting your keywoard and use '/Library/Application Support/org.pqrs/Karabiner-Elements/bin/karabiner_cli' --select-profile 'Default Profile' to switch back and forth.

judge2005 commented 7 months ago

I knew I'd seen this suggestion somewhere. I have packed all this up in to a zip and included instructions how to use here. It is a fork of this repo, so happy to make a pull request, but there are a lot of additional instructions for getting Karabiner to use the shell script - i.e. the readme now focusses solely on that.