https://github.com/thor/ledctl
Easily toggle Num Lock, Caps Lock, and Scroll Lock, several times, graphically or from the CLI on macOS
https://github.com/thor/ledctl
cli gui macos
Last synced: 16 days ago
JSON representation
Easily toggle Num Lock, Caps Lock, and Scroll Lock, several times, graphically or from the CLI on macOS
- Host: GitHub
- URL: https://github.com/thor/ledctl
- Owner: thor
- Created: 2026-05-13T18:36:22.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2026-05-13T21:25:35.000Z (about 2 months ago)
- Last Synced: 2026-05-13T22:29:15.400Z (about 2 months ago)
- Topics: cli, gui, macos
- Language: Rust
- Homepage:
- Size: 205 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# ledctl
Control keyboard indicator LEDs (Caps Lock, Num Lock, Scroll Lock) on macOS.
## Background
Some hardware uses keyboard LED state as a signaling channel. Certain programmable keyboards, stream decks, and other input peripherals watch for Num Lock, Scroll Lock, or Caps Lock changes to trigger behaviour — essentially treating the LED as a software-controlled output pin. macOS provides no built-in way to drive these LEDs programmatically; they're only toggled as a side effect of pressing the physical key.
`ledctl` talks directly to the IOKit HID layer, letting you set LED state without a keypress. The `--count N` toggle option covers hardware that distinguishes a sequence of N toggles from a single one.
## Install
Download the universal binary from the [latest release](https://github.com/thor/ledctl/releases/latest) and put it somewhere on your `$PATH`.
## Usage
```
ledctl --list
ledctl [--device ] [--count ]
```
Running without arguments opens a small GUI.
```sh
# Turn Num Lock on across all keyboards
ledctl num on
# Toggle Scroll Lock 3 times on a specific keyboard
ledctl --device "Keychron" scroll toggle --count 3
# List connected keyboards with their location IDs
ledctl --list
```
## Requirements
macOS 11.0 or later.