| OLD | NEW |
| 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 |
| OLD | NEW |