Show HN: Mac hardware toys – pipe your accelerometer into your keyboard lights
3 points - today at 8:43 PM
Sourcenikisweeting
today at 8:47 PM
Inspired by the recent post where Olivier Bourbonnais figured out how to read the private accelerometer APIs on Apple Silicon macs: https://github.com/olvvier/apple-silicon-accelerometer
I created a set of CLI tools that let you pipe mac sensor data around like modular synth audio. Sensor data is outputted via stdout as a mono audio signal, and then it can be piped through filters and sent to outputs like your speaker, screen-brightness, keyboard-brightness, a TUI visualizer, and more.
Some examples of silly things that are possible:
lid-angle | speaker # sounds like a theremin as you move th elid
sudo accelerometer | metronome | screen-brightness # tap on your palmrest and it will flash to the beat
microphone | metronome | speaker # play a tone in sync with whatever beat is audible to the microphone (syncs the phase too)
microphone | bandpass 0.4 6 | volume-shift 2 | tee >(keyboard-brightness) | visualizer
sudo gyroscope | sudo fan-speed
Lots more here:
https://github.com/pirate/mac-hardware-toys