Skip to content
brenschPublic

About

key bindings for the modern man

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

32 Commits

Folders and files

Repository files navigation

nocaps icon

nocaps

Turn Caps Lock into a keyboard layer. Arrows, editing, modifiers and media on the home row, on Windows, macOS and Linux.

Build Release License: MIT

Windows · macOS Apple Silicon / Intel · Linux

nocaps configuration window

How it works

Hold Caps Lock and press a bound key. Caps Lock itself never toggles while nocaps is enabled.

Hold Caps Lock + Does Hold Caps Lock + Does
I J K L ↑ ← ↓ → A / S / D / F + a movement key Word jump / Select / Workspace / Window focus
H / ; Home / End Q / W / Tab Volume down / up / mute
U / O Backspace / Delete E / R / T Previous / play-pause / next

Combine freely: Caps Lock + A + J jumps a word left, and adding S selects it. Combos do the same thing on every OS: on macOS words use Option and Home/End become Cmd+←/→. Caps Lock + D + J/L switches workspace left/right with each OS's own shortcut: Ctrl+Alt+←/→ on Linux, Control+←/→ (Mission Control Spaces) on macOS, Ctrl+Win+←/→ on Windows. On GNOME, adding S takes the focused window with you. On Linux, Caps Lock + F + IJKL sends Super+Ctrl+Alt+arrow for a tiling extension's directional focus (for GNOME's Tiling Shell, bind focus-window-left/right/up/down to it).

nocaps runs in the system tray. Choose Configure to rebind: click a key, press the new one, and it is applied and saved instantly.

Install

Windows Run nocaps-windows.exe. To start at sign-in, put it in shell:startup.
macOS chmod +x nocaps-macos-* && xattr -d com.apple.quarantine nocaps-macos-*, run it, then allow it under System Settings → Privacy & Security → Accessibility.
Linux Needs read access to /dev/input and write access to /dev/uinput: sudo usermod -aG input "$USER", then sign out and back in. Keyboards plugged in later (or reconnected through a dock) are picked up automatically. nocaps adds itself to the app grid; launching it again opens the running copy's window.

Fast by design

Every platform uses its lowest-level input interface short of a kernel driver: a WH_KEYBOARD_LL hook on Windows, a Core Graphics event tap on macOS, and evdev/uinput on Linux. Bindings live in a static table, so each key event costs one memory load: no locks, allocation or lookups. The window does no work while it sits in the tray.

Details

Configuration file

Changes made in the window are saved as JSON:

  • Windows: %APPDATA%\nocaps\config.json
  • macOS: ~/Library/Application Support/nocaps/config.json
  • Linux: ~/.config/nocaps/config.json
{
  "version": 1,
  "enabled": true,
  "bindings": { "arrow_up": "i", "left_control": "a", "volume_mute": "tab" }
}

Each action takes one key and each key triggers one action. Defaults are compiled in from config/default.json.

macOS and Caps Lock

macOS latches Caps Lock in its HID driver, below any app, so nocaps uses hidutil to remap Caps Lock to F18 while enabled. Disabling or quitting restores your previous mapping. If nocaps is force-killed, Caps Lock acts as F18 until nocaps is next run or the Mac restarts.

Building from source
cargo build --release

Linux also needs libgtk-3-dev libayatana-appindicator3-dev.

License

MIT. Icon cap from Twemoji (CC-BY 4.0); interface font Inter (SIL OFL 1.1).

About

key bindings for the modern man

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages