logoalt Hacker News

vinnymac07/31/20250 repliesview on HN

Nice, I might consider forking yours to only do this if the lid is closed, as I leave my laptop open but locked doing things all the time at my desk.

> ioreg -r -k AppleClamshellState -d 4 | grep AppleClamshellState | head -1