File: power.sh

package info (click to toggle)
acpi-support 0.142-8
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 788 kB
  • sloc: sh: 1,068; ansic: 131; makefile: 33
file content (16 lines) | stat: -rw-r--r-- 314 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

test -f /usr/share/acpi-support/key-constants || exit 0

. /usr/share/acpi-support/power-funcs
. /usr/share/acpi-support/policy-funcs

if { CheckPolicy || CheckUPowerPolicy; }; then
    exit
fi

if `cat /sys/class/power_supply/A*/online | grep -q 1`; then
	pm-powersave false
else
	pm-powersave true
fi