spacepaste

  1.  
  2. #!/bin/sh
  3. # /etc/acpi/default.sh
  4. # Default acpi script that takes an entry for all actions
  5. set $*
  6. group=${1%%/*}
  7. action=${1#*/}
  8. device=$2
  9. id=$3
  10. value=$4
  11. log_unhandled() {
  12. logger "ACPI event unhandled: $*"
  13. }
  14. case "$group" in
  15. button)
  16. case "$action" in
  17. power)
  18. /etc/acpi/actions/powerbtn.sh
  19. # if your laptop doesnt turn on/off the display via hardware
  20. # switch and instead just generates an acpi event, you can force
  21. # X to turn off the display via dpms. note you will have to run
  22. # 'xhost +local:0' so root can access the X DISPLAY.
  23. #lid)
  24. # xset dpms force off
  25. # ;;
  26. *) log_unhandled $* ;;
  27. esac
  28. ;;
  29. ac_adapter)
  30. case "$value" in
  31. # Add code here to handle when the system is unplugged
  32. # (maybe change cpu scaling to powersave mode). For
  33. # multicore systems, make sure you set powersave mode
  34. # for each core!
  35. #*0)
  36. # cpufreq-set -g powersave
  37. # ;;
  38. # Add code here to handle when the system is plugged in
  39. # (maybe change cpu scaling to performance mode). For
  40. # multicore systems, make sure you set performance mode
  41. # for each core!
  42. #*1)
  43. # cpufreq-set -g performance
  44. # ;;
  45. *) log_unhandled $* ;;
  46. esac
  47. ;;
  48. video)
  49. case "$action" in
  50. brightnessup) /etc/acpi/actions/backlight.sh up ;;
  51. brightnessdown) /etc/acpi/actions/backlight.sh down ;;
  52. *) log_unhandled $* ;;
  53. esac ;;
  54. *) log_unhandled $* ;;
  55. esac
  56.