Skip to content
Mrkh97Public

About

A tiny lightning bolt strikes every character you type, anywhere on your Mac. The word you're typing gets electrocuted.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Light Key icon

Light Key

A tiny lightning bolt strikes every character you type, anywhere on your Mac.
The word you're typing gets electrocuted, and the odd drop of molten metal falls off it.

Download for macOS · macOS 14 Sonoma or later · Apple silicon and Intel

Typing "the quick brown fox jumps over the lazy dog": a bolt strikes each letter as it appears, the word being typed flashes white-hot and jolts, and small molten drops fall from it

Light Key lives in the menu bar as ⚡. It works in most apps you type in, including native Mac apps, browsers and Electron apps like VS Code. The bolt lands on the character you just typed, not at the mouse pointer. Type fast and the strikes build up power; press Return for a big one.

Install

Homebrew

brew install --cask mrkh97/tap/light-key

Then open Light Key from your Applications folder and look for ⚡ in the menu bar. Update with brew upgrade --cask light-key. If you installed Light Key by hand before, add --force the first time so Homebrew can replace that copy.

Download

  1. Download LightKey.zip from the latest release and unzip it.
  2. Drag Light Key.app into your Applications folder and open it. Light Key is signed and notarized by Apple, so macOS only asks once whether you want to open an app you downloaded.
  3. Allow the two permissions below, then start typing anywhere.

Permissions

Accessibility (required). Light Key needs it to notice keystrokes and to ask the app you're typing in where the character it just inserted is on screen. macOS asks on first launch; you can also turn it on in System Settings → Privacy & Security → Accessibility. Light Key never records what you type: it only looks up where the last character landed.

Screen Recording (optional). With it, the word you're typing gets electrocuted: its actual letters strobe white-hot and electric blue and jolt out of place. To do that, Light Key grabs just the few pixels under the word right after a keystroke, and never saves or sends them anywhere. Turn it on from ⚡ → Electrify Letters (Screen Recording)… or in System Settings → Privacy & Security → Screen & System Audio Recording; macOS may ask you to reopen the app. While you type, macOS shows its purple privacy dot in the menu bar.

Without Screen Recording you still get the bolts and the molten drops, with small arcs crackling over the word instead.

The permissions carry over when you update Light Key.

Build from source

You need macOS 14 or later and Xcode or the Xcode command line tools (xcode-select --install).

git clone https://github.com/Mrkh97/light-key.git
cd light-key
./build.sh --install    # builds the app, copies it to /Applications/Light Key.app and opens it

./build.sh alone just builds build/LightKey.app. ./build.sh --release makes a universal (Apple silicon + Intel) build and zips it as build/LightKey.zip.

Without a Developer ID certificate the app is ad-hoc signed, which is all you need to run your own build, but macOS asks for the permissions again after each rebuild. With one in your keychain, build.sh signs with it, and --release also has Apple notarize the app; the top of build.sh shows the one-time setup. Publishing a GitHub release with that LightKey.zip attached updates the Homebrew cask automatically (see .github/workflows/homebrew.yml).

Uninstall

With Homebrew: brew uninstall --cask light-key (add --zap to also forget its settings). By hand: quit Light Key from its menu and drag Light Key.app to the Trash. To also forget its settings: defaults delete dev.lightkey.app. To clear its permissions: tccutil reset All dev.lightkey.app.

The menu

Click ⚡ in the menu bar:

Enabled Turn the effect on or off
Color Electric Blue, Gold, Violet or Toxic Green
Grant Accessibility Access… Shown until the permission is on
Electrify Letters (Screen Recording)… Shown until the permission is on
Quit Light Key

Where it works

Light Key asks the focused app, through the macOS Accessibility API, where the character before the text cursor is. Native Mac apps answer with the selected text range; browsers and Electron apps answer with text markers (Light Key asks Electron apps to switch their accessibility support on). So it works in native apps like TextEdit and Notes, in Chromium browsers, and in Electron apps like VS Code.

Apps that draw their own text without telling macOS where it is get no strike. That includes GPU-rendered terminals and most games.

Electrocuted letters work best on plain backgrounds, light text on dark or dark text on light. On busy backgrounds Light Key may not find the letters and skips that part.

How it works

Light Key is one Swift file (Sources/main.swift) with no dependencies.

Piece Where
Finding the typed character: the selected text range for native apps, text markers for web content Caret
Transparent, click-through overlay windows, one per display OverlayWindow
The bolt: fractal midpoint displacement, slanted 12–50° from either side, with branches and twigs Lightning.discharge
Bloom: each bolt is rendered once to a bitmap with blurred glow passes; Core Animation then only fades it Lightning.render, Lightning.strike
Molten drops: they bead up, hang, fall with gravity and cool from white-hot to dull red Lightning.drip
Electrocuted letters: separate the letters from the background in a capture of the word, erase them, and redraw them glowing and knocked out of place Electrify
Capturing just the word, without Light Key's own effects in it WordCapture (ScreenCaptureKit)

Performance: each strike is a few pre-rendered images faded by the window server, with no per-frame drawing. Typing nonstop costs a few percent of one CPU core. With Screen Recording on, the word capture adds well under 1% in Light Key and a few percent in macOS's capture service. Strikes are capped so they can never pile up.

Developer flags

build/LightKey.app/Contents/MacOS/LightKey --demo              # fake typing at the center of the main display, no permissions needed
build/LightKey.app/Contents/MacOS/LightKey --showcase          # a text box that types by itself (docs/make-demo.sh films it)
build/LightKey.app/Contents/MacOS/LightKey --icon icon.png     # render an app icon (the bolt is random every time)
LIGHTKEY_DEBUG=1 build/LightKey.app/Contents/MacOS/LightKey    # log where each character was found

The log is ~/Library/Logs/LightKey.log. It's cleared each time the app starts.

About

A tiny lightning bolt strikes every character you type, anywhere on your Mac. The word you're typing gets electrocuted.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages