#!/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