Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1297)

Unified Diff: src/platform/acpi/action_lid.sh

Issue 671023: Add support to auto-shutdown on lid close if no one is logged in (Closed)
Patch Set: remove the deprecated comment Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/platform/init/login.conf » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/acpi/action_lid.sh
diff --git a/src/platform/acpi/action_lid.sh b/src/platform/acpi/action_lid.sh
index 48decf55461e10f0076add8a88e7628b291bf3c4..48c8821e7e52a602507d7aae49450ae3f10e28a5 100755
--- a/src/platform/acpi/action_lid.sh
+++ b/src/platform/acpi/action_lid.sh
@@ -4,6 +4,12 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+# Shutdown instead of sleeping if no one is logged in
+if ! test -f /var/run/state/logged-in; then
+ shutdown -h now
+ exit 0
+fi
+
# On lid close:
# - lock the screen
export HOME=/home/chronos
« no previous file with comments | « no previous file | src/platform/init/login.conf » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698