~ubuntu-branches/ubuntu/precise/laptop-mode-tools/precise

« back to all changes in this revision

Viewing changes to .pc/debian-changes/etc/power/scripts.d/laptop-mode

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-10-19 12:16:45 UTC
  • mfrom: (2.1.16 sid)
  • Revision ID: james.westby@ubuntu.com-20111019121645-5397gmgo8wqkskjm
Tags: 1.58-3ubuntu1
* Merge with Debian testing. Remaining Ubuntu changes:
  - debian/rules: Do not ship obsolete acpi/apm scripts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
# name        : laptop-mode
 
4
# author      : Matthias Grimm <matthiasgrimm@users.sourceforge.net>
 
5
# description : toggle laptop mode in kernel and adjust
 
6
#               memory management buffer flush timeouts
 
7
# requirements: laptop-mode support in kernel
 
8
#               laptopmode.sh somewhere on your system
 
9
# limitations : none 
 
10
#
 
11
# --- end of public part -- don't change below this line ---
 
12
 
 
13
set -e
 
14
LMODE=/usr/sbin/laptop_mode
 
15
 
 
16
[ -x $LMODE ] || exit 0
 
17
 
 
18
if [ -w /proc/sys/vm/laptop_mode ]; then
 
19
    case "$1" in
 
20
      powersave)
 
21
        $LMODE "start"
 
22
        echo "3 " $LMODE "start"
 
23
        ;;
 
24
      custom)
 
25
        $LMODE "auto"
 
26
        ;;
 
27
      performance)
 
28
        $LMODE "stop"
 
29
        ;;
 
30
      resume)
 
31
        /etc/init.d/laptop-mode restart
 
32
        ;;        
 
33
    esac
 
34
elif [ -x logger ]; then        
 
35
  logger -p daemon.error -t laptop-mode "Laptop-mode support missing in kernel."
 
36
fi
 
37
 
 
38