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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/platform/init/login.conf » ('j') | 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
8 if ! test -f /var/run/state/logged-in; then
9 shutdown -h now
10 exit 0
11 fi
12
7 # On lid close: 13 # On lid close:
8 # - lock the screen 14 # - lock the screen
9 export HOME=/home/chronos 15 export HOME=/home/chronos
10 /usr/bin/xscreensaver-command -l 16 /usr/bin/xscreensaver-command -l
11 17
12 # - suspend the cryptohome device 18 # - suspend the cryptohome device
13 #CRYPTOHOME=/dev/mapper/cryptohome 19 #CRYPTOHOME=/dev/mapper/cryptohome
14 #/usr/bin/test -b $CRYPTOHOME && /sbin/dmsetup suspend $CRYPTOHOME 20 #/usr/bin/test -b $CRYPTOHOME && /sbin/dmsetup suspend $CRYPTOHOME
15 21
16 # - suspend to ram 22 # - suspend to ram
17 echo -n mem > /sys/power/state 23 echo -n mem > /sys/power/state
18 24
19 # On lid open: 25 # On lid open:
20 # - has it such that you don't have to press a key to display lock screen 26 # - has it such that you don't have to press a key to display lock screen
21 /usr/bin/xscreensaver-command -deactivate 27 /usr/bin/xscreensaver-command -deactivate
22 28
23 # - resume cryptohome device 29 # - resume cryptohome device
24 #/usr/bin/test -b $CRYPTOHOME && /sbin/dmsetup resume $CRYPTOHOME 30 #/usr/bin/test -b $CRYPTOHOME && /sbin/dmsetup resume $CRYPTOHOME
OLDNEW
« 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