Skip to content

Latest commit

 

History

31 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DeskLock 🔒🚲

A macOS menu-bar app that locks your screen — blurs everything, kills the keyboard and mouse — while keeping your Mac wide awake so long-running work survives. Close the lid, walk away, come back hours later: your Claude Code sessions, servers, and downloads are still running. Unlock with a 4-digit PIN.

Built in one shot with Claude, for the delightfully meta reason of keeping AI agents running while the screen is locked. A fun project — ship it, use it, break it.

While locked, the screen shows a little coral Claude leading a pack of cyclists across a frosted blur, and the scene reacts to the input it's swallowing: your mouse leaves a glowing trail, every blocked keystroke throws a spark, and the bikes pedal harder the more you mash.

Features

  • Locks people out, not processes — full-screen blur on every display, all keyboard/mouse input swallowed at the event-tap level (Cmd-Tab, Force-Quit, media keys — all dead).
  • Stays awake, lid closed included — holds an IOKit power assertion; optional pmset disablesleep so a closed clamshell keeps working.
  • 4-digit PIN — salted SHA-256 in the Keychain, escalating lockout after wrong tries.
  • Ambient scene — Claude + bikes, reacting to your (blocked) input.
  • Tunable look — independent Blur and Background-opacity sliders with live preview, plus a solid-black Opaque mode.
  • Menu-bar only, global hotkey ⌃⌥⌘L, crash-safe (a crash just leaves your Mac normal).

Setup (once)

  1. ./scripts/setup-signing.sh — stable code-signing identity so macOS keeps the Accessibility grant across rebuilds (login password once)
  2. ./scripts/bundle.sh — builds build/DeskLock.app and installs it to /Applications
  3. open /Applications/DeskLock.app — a lock icon appears in the menu bar
  4. Menu → Set PIN… — choose your 4-digit PIN
  5. First lock asks for Accessibility permission (System Settings → Privacy & Security → Accessibility → enable DeskLock), then lock again
  6. Optional, for lid-closed operation: ./scripts/setup-sudoers.sh (admin password once), then enable menu → Keep Awake When Lid Closes

Use

  • Lock: menu → Lock Now, or ⌃⌥⌘L from anywhere
  • Unlock: type your 4-digit PIN (Backspace clears; 3 wrong → 30 s lockout, doubling after)
  • Blur / Background opacity sliders in the menu, with a live preview as you drag

Boundaries (by design)

  • Deterrence lock, not a vault: a hard power-cycle reboots to the macOS login screen — the intruder still can't get in, but your session dies.
  • SSH and remote access are unaffected.
  • Heat: a closed laptop under load runs hot. Desk, not bag.
  • Touch ID isn't supported — macOS forces a system prompt for third-party biometric auth, which conflicts with a full-screen lock, so DeskLock is PIN-only on purpose.
  • On unlock and at launch, DeskLock resets pmset disablesleep to 0 (including a value set outside the app).

Build from source

swift build           # or ./scripts/bundle.sh for the .app
swift run desklock-tests   # assert-based tests (no Xcode/XCTest needed)

Swift Package Manager, zero dependencies, macOS 13+.

About

macOS menu-bar screen lock that keeps your work alive — holds an IOKit power assertion so agents, servers and downloads survive a locked screen.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages