spank

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2026 License: 0BSD Imports: 20 Imported by: 0

README

spank

Slap your MacBook, it yells back.

Uses the Apple Silicon accelerometer (Bosch BMI286 IMU via IOKit HID) to detect physical hits on your laptop and plays audio responses. Single binary, no dependencies.

Requirements

  • macOS on Apple Silicon (M2+)
  • sudo (for IOKit HID accelerometer access)

Install

Download from the latest release.

Or build from source:

GOPRIVATE=github.com/taigrr/apple-silicon-accelerometer go install github.com/taigrr/spank@latest

Usage

# Normal mode — says "ow!" when slapped
sudo spank

# Sexy mode — escalating responses based on slap frequency
sudo spank --sexy
Modes

Pain mode (default): Randomly plays from 10 pain/protest audio clips when a slap is detected.

Sexy mode (--sexy): Tracks slaps within a rolling 1-minute window. The more you slap, the more intense the audio response. 60 levels of escalation.

How it works

  1. Reads raw accelerometer data directly via IOKit HID (Apple SPU sensor)
  2. Runs vibration detection (STA/LTA, CUSUM, kurtosis, peak/MAD)
  3. When a significant impact is detected, plays an embedded MP3 response
  4. 500ms cooldown between responses to prevent rapid-fire

License

0BSD

Documentation

Overview

spank detects slaps/hits on the laptop and plays audio responses. It reads the Apple Silicon accelerometer directly via IOKit HID — no separate sensor daemon required. Needs sudo.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL