home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / etc / acpi / panapower.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  2006-10-15  |  287 b   |  16 lines

  1. #!/bin/sh
  2.  
  3. . /usr/share/acpi-support/power-funcs
  4.  
  5. grep -q off-line /proc/acpi/ac_adapter/*/state
  6.  
  7. if [ $? = 0 ]
  8.         then
  9.     INTERFACE="dc_brightness"
  10. else
  11.     INTERFACE="ac_brightness"
  12. fi
  13.  
  14. BRIGHTNESS=$(( `cat /proc/acpi/pcc/$INTERFACE` + 0 ))
  15. echo $BRIGHTNESS > /proc/acpi/pcc/$INTERFACE
  16.