Files
blomarchy/bin/blob-hw-laptop-closed
T

12 lines
227 B
Bash
Executable File

#!/bin/bash
# blob:summary=Returns true when the laptop lid is closed
# blob:hidden=true
for state in /proc/acpi/button/lid/*/state; do
[[ -r $state ]] || continue
[[ $(< "$state") == *"closed"* ]] && exit 0
done
exit 1