lid-state − query state of the device's lid
lid−state
lid−state (−−open |
−−closed) [−−
<cmd...>]
lid−state (−−version |
−−help)
lid−state, if invoked without any arguments, prints the current state of the lid: “open” or “closed”.
lid−state, invoked with −−open or −−closed and no cmd, exits with status 0 if the current lid state corresponds to the specified option, otherwise exits with status 1.
lid−state, invoked with cmd, runs the cmd if the current lid state corresponds to the specified option, otherwise just exits with status 0.
−o, −−open
If cmd is given: execute
cmd if the lid is open, otherwise do nothing and exit
with 0.
If cmd is not given: exit with 0 if the lid is open,
otherwise exit with 1.
−c, −−closed
Analogous to −−open.
−V, −−version
Print script name & version and exit.
−h, −−help
Print the help message and exit.
/proc/acpi/button/lid/LID/state
State of the lid exported by the ACPI subsystem.
• 0 — Clean exit, no error has encountered.
• 1 — See DESCRIPTION.
• 100 — Invalid usage.
• 101 — Failed to read /proc/acpi/button/lid/LID/state.
If cmd is given and the condition (−−open or −−closed) is met, lid−state exits with the exit status of the cmd.
Jakub Jirutka
Report bugs to the project’s issue tracker at <https://github.com/jirutka/acpi−utils/issues>.