# samhenrigold/lidanglesensor

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/samhenrigold-lidanglesensor).**

4,125 stars · 174 forks · Swift · Apache-2.0

## Links

- GitHub: https://github.com/samhenrigold/LidAngleSensor
- Homepage: https://samhenri.gold
- awesome-repositories: https://awesome-repositories.com/repository/samhenrigold-lidanglesensor.md

## Description

LidAngleSensor is a tool and sensor interface that retrieves the physical opening angle of a laptop screen by querying the internal Human Interface Device. It translates raw hardware sensor reports into a numerical representation of the lid's position.

The project functions as a lid-triggered audio player and a screen region capture tool. It can monitor hardware sensor state changes to play specific sound effects when a laptop lid opens or closes and isolate a defined coordinate area of the display buffer to copy a specific screen region to the clipboard.

The system handles hardware event automation and HID sensor integration through threshold-based event triggering and coordinate-based buffer cropping.

## Tags

### Hardware & IoT

- [Laptop Lid Sensors](https://awesome-repositories.com/f/hardware-iot/laptop-lid-sensors.md) — Determines the current opening angle of the laptop screen by accessing the internal hardware sensor. ([source](https://cdn.jsdelivr.net/gh/samhenrigold/lidanglesensor@main/README.md))
- [HID Device Communication](https://awesome-repositories.com/f/hardware-iot/hid-device-communication.md) — Queries Human Interface Device reports to read raw lid position sensor data.
- [Sensor Integrations](https://awesome-repositories.com/f/hardware-iot/integration-performance/hardware-interfacing-integration/hardware-integration/device-sensors/external-integrations/sensor-integrations.md) — Interfaces with HID reports to retrieve raw sensor data and translate it into software values.
- [Sensor Polling](https://awesome-repositories.com/f/hardware-iot/integration-performance/hardware-interfacing-integration/hardware-integration/device-sensors/sensor-polling.md) — Retrieves the current state of the lid angle sensor via on-demand polling.
- [Sensor-Driven Event Triggers](https://awesome-repositories.com/f/hardware-iot/embedded-robotics/sensor-processing/analog-sensor-calibration/analog-sensor-integrations/sensor-driven-event-triggers.md) — Fires audio callbacks when monitored sensor values cross predefined numerical boundaries.

### Data & Databases

- [Raw-to-Angle Conversions](https://awesome-repositories.com/f/data-databases/data-serialization-formats/output-formatting-systems/string-converters/mathematical-data-to-string-converters/angle-unit-converters/raw-to-angle-conversions.md) — Converts raw hardware sensor output into a numerical representation of the lid opening angle.

### Operating Systems & Systems Programming

- [Hardware-to-Software Mappings](https://awesome-repositories.com/f/operating-systems-systems-programming/hardware-to-software-mappings.md) — Translates raw hardware sensor reports into numerical values representing the laptop lid's physical position.
- [Lid Event Management](https://awesome-repositories.com/f/operating-systems-systems-programming/lid-event-management.md) — Retrieves the angle of the MacBook lid via the internal human interface device sensor. ([source](https://samhenri.gold/labs))
- [Audio Triggers](https://awesome-repositories.com/f/operating-systems-systems-programming/lid-event-management/audio-triggers.md) — Provides a system that triggers specific sound effects automatically when the laptop lid is opened or closed.
- [Lid State Monitoring](https://awesome-repositories.com/f/operating-systems-systems-programming/lid-state-monitoring.md) — Reads the physical opening angle of a laptop screen using internal hardware sensors to trigger software actions.

### System Administration & Monitoring

- [Hardware Event Automations](https://awesome-repositories.com/f/system-administration-monitoring/hardware-event-automations.md) — Executes tasks and plays sounds automatically based on the physical state of the laptop lid.

### Development Tools & Productivity

- [Audio Triggers](https://awesome-repositories.com/f/development-tools-productivity/workflow-automation-triggers/event-driven-triggers/audio-triggers.md) — Triggers specific audio playback in response to hardware sensor state changes.

### Graphics & Multimedia

- [On-Demand Audio Triggers](https://awesome-repositories.com/f/graphics-multimedia/audio-music/audio-playback/on-demand-audio-triggers.md) — Triggers specific sound effects whenever the laptop lid is opened or closed. ([source](https://cdn.jsdelivr.net/gh/samhenrigold/lidanglesensor@main/README.md))
- [State-Change Audio Feedback](https://awesome-repositories.com/f/graphics-multimedia/sound-effect-libraries/interactive-sound-effect-managers/state-change-audio-feedback.md) — Connects physical lid position changes to the playback of corresponding sound effects.
- [Region Capture](https://awesome-repositories.com/f/graphics-multimedia/streaming-distribution/display-capture/display-screenshot-capture/region-capture.md) — Implements the ability to isolate and copy a specific coordinate-defined rectangular area of the display buffer.
