blob: 7c66d874cc5f61b9b01793dc528eea5ab6a2436c [file] [log] [blame]
#!/bin/sh
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
logger "action_lid.sh: " `cat /proc/acpi/button/lid/*/state`
grep -q "closed" /proc/acpi/button/lid/*/state
if [ $? != 0 ]; then
logger "action_lid.sh: lid is not closed. Bailing out."
exit 0
fi
logger "action_lid.sh: lid closed. Requesting suspend."
/usr/bin/dbus-send --type=signal --system / \
org.chromium.PowerManager.RequestSuspend