Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Set your keyboard LEDs from the Mac OS X command-line

License

NotificationsYou must be signed in to change notification settings

judge2005/setledsmac

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This is for those who useKarabiner and want theNum Lock key on their keypad to not only remap the keys(which Karabiner can do) but also set the Num Lock led correctly on the keyboard (which, as of this writing, Karabiner can't do).

Overview

To get this to work there is a script calledsetleds_karabiner.sh that can be run from Karabiner (or the command line for that matter).This script works by first selecting a profile in Karabiner that does not include any keyboards - you must define this yourself.Then it usessetleds to set the numlock led to the desired state. Then it sets the Karabiner profile back to whatever wasactive when you ran the shell script.

The script is fairly bullet-proof, e.g

  • It should work even if there are spaces in things like path names
  • If you run it with the wrong number of arguments it prints out a usage message
  • It checks that the 'no keyboard' profile you want to use actually exists before it does anything
  • It will keep trying thesetleds command until it either works or 2s have passed (there is a delay betweenwhen Karabiner returns from the set profile command and when it actually takes itself out of the way).

Installation

Download thesetleds_karabiner.zip fromreleases. It contains:

  • setleds binary
  • setleds_karabiner.sh
  • enable_numlock_toggle.json
  • numpad_keys.json

In no particular order:

  • Create a folder calledbin directly under your home directory and put both thesetleds binary andsetleds_karabiner.sh in it. If you don't do this you will have to editenable_numlock_toggle.json and if setleds and setleds_karabiner.sh are in different directories, you will have to edit the shell script too.
  • Create a profile in Karabiner that does not contain any devices. Call itNo keyboard. If you call it something else, you will have to editenable_numlock_toggle.json to pass that profile name as a second argument to setleds_karabiner.sh.
  • Loadenable_numlock_toggle.json as a complex rule in Karabiner. If you have already loaded 'Enable Num Lock Toggle', replace it withenable_numlock_toggle.json.
  • Optionally loadnumpad_keys.json as a complex rule - this is what remaps the keys. If you already have 'Numpad keys' installed, you can just use that. I only provide it so this zip is a one-stop-shop.
  • Read the Notes section below before you go hammering the numlock key - it will help avoid any issues.

Notes

  • If you haven't run setleds before, you will need to get the Mac to allow it. The easiest way is to run it from the finder by selecting 'Open' on the context menu. You should be given the option of adding it to the safe list.
  • The first time you hit the numlock key, assuming everything works, you should see a popup telling you you need to addkarabiner_console_user_server to the list of 'allowed applications' in the 'Input Monitoring' part of System Settings. It won't work if you don't do this. You can also just got to Input Monitoring and add it yourself.

Troubleshooting

If it doesn't work, look in thelogs section of Karabiner

About

Set your keyboard LEDs from the Mac OS X command-line

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C83.7%
  • Shell15.1%
  • Makefile1.2%

[8]ページ先頭

©2009-2025 Movatter.jp