// 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. package main import ( "bufio" "bytes" "context" "embed" "encoding/json" "fmt" "io" "math" "math/rand" "os" "os/signal" "sort" "strings" "sync" "syscall" "time" "github.com/charmbracelet/fang" "github.com/gopxl/beep/v2" "github.com/gopxl/beep/v2/effects" "github.com/gopxl/beep/v2/mp3" "github.com/gopxl/beep/v2/speaker" "github.com/spf13/cobra" "github.com/taigrr/apple-silicon-accelerometer/detector" "github.com/taigrr/apple-silicon-accelerometer/sensor" "github.com/taigrr/apple-silicon-accelerometer/shm" ) var version = "dev" //go:embed audio/pain/*.mp3 var painAudio embed.FS //go:embed audio/sexy/*.mp3