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

Side by Side Diff: src/platform/acpi/action_lid.sh

Issue 1084013: Added check to ensure LID is in a closed state before proceeding (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/sh 1 #!/bin/sh
2 2
3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 # Shutdown instead of sleeping if no one is logged in 7 # Shutdown instead of sleeping if no one is logged in
8 if ! test -f /var/run/state/logged-in; then 8 if ! test -f /var/run/state/logged-in; then
9 shutdown -h now 9 shutdown -h now
10 exit 0 10 exit 0
11 fi 11 fi
12 12
13 # Check whether the lid is closed before proceeding
14 grep -q open /proc/acpi/button/lid/*/state
15 if [ $? = 0 ]; then
16 exit 0
17 fi
18
13 # On lid close: 19 # On lid close:
14 # - lock the screen 20 # - lock the screen
15 export HOME=/home/chronos 21 export HOME=/home/chronos
16 /usr/bin/xscreensaver-command -l 22 /usr/bin/xscreensaver-command -l
17 23
18 # - suspend the cryptohome device 24 # - suspend the cryptohome device
19 #CRYPTOHOME=/dev/mapper/cryptohome 25 #CRYPTOHOME=/dev/mapper/cryptohome
20 #/usr/bin/test -b $CRYPTOHOME && /sbin/dmsetup suspend $CRYPTOHOME 26 #/usr/bin/test -b $CRYPTOHOME && /sbin/dmsetup suspend $CRYPTOHOME
21 27
22 # - suspend to ram 28 # - suspend to ram
23 echo -n mem > /sys/power/state 29 echo -n mem > /sys/power/state
24 30
25 # On lid open: 31 # On lid open:
26 # - has it such that you don't have to press a key to display lock screen 32 # - has it such that you don't have to press a key to display lock screen
27 /usr/bin/xscreensaver-command -deactivate 33 /usr/bin/xscreensaver-command -deactivate
28 34
29 # - resume cryptohome device 35 # - resume cryptohome device
30 #/usr/bin/test -b $CRYPTOHOME && /sbin/dmsetup resume $CRYPTOHOME 36 #/usr/bin/test -b $CRYPTOHOME && /sbin/dmsetup resume $CRYPTOHOME
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698