dominic revised this gist . Go to revision
1 file changed, 33 insertions
powersave-freebsd.sh(file created)
@@ -0,0 +1,33 @@ | |||
1 | + | #! /bin/sh | |
2 | + | # | |
3 | + | # Author: Dominic Reich <quick.hat4396@qtztsjosmprqmgtunjyf.com> | |
4 | + | ||
5 | + | case $( sysctl -n hw.acpi.acline ) in | |
6 | + | ||
7 | + | (0) # BATTERY | |
8 | + | doas sysctl dev.hwpstate_intel.0.epp=100 1> /dev/null 2> /dev/null | |
9 | + | doas sysctl dev.hwpstate_intel.1.epp=100 1> /dev/null 2> /dev/null | |
10 | + | doas sysctl dev.hwpstate_intel.2.epp=100 1> /dev/null 2> /dev/null | |
11 | + | doas sysctl dev.hwpstate_intel.3.epp=100 1> /dev/null 2> /dev/null | |
12 | + | doas sysctl dev.hwpstate_intel.4.epp=100 1> /dev/null 2> /dev/null | |
13 | + | doas sysctl dev.hwpstate_intel.5.epp=100 1> /dev/null 2> /dev/null | |
14 | + | doas sysctl dev.hwpstate_intel.6.epp=100 1> /dev/null 2> /dev/null | |
15 | + | doas sysctl dev.hwpstate_intel.7.epp=100 1> /dev/null 2> /dev/null | |
16 | + | #backlight 20 1> /dev/null 2> /dev/null | |
17 | + | backlight $(cat ${HOME}/.backlight-bat) 1> /dev/null 2> /dev/null | |
18 | + | ;; | |
19 | + | ||
20 | + | (1) # AC | |
21 | + | doas sysctl dev.hwpstate_intel.0.epp=0 1> /dev/null 2> /dev/null | |
22 | + | doas sysctl dev.hwpstate_intel.1.epp=50 1> /dev/null 2> /dev/null | |
23 | + | doas sysctl dev.hwpstate_intel.2.epp=100 1> /dev/null 2> /dev/null | |
24 | + | doas sysctl dev.hwpstate_intel.3.epp=100 1> /dev/null 2> /dev/null | |
25 | + | doas sysctl dev.hwpstate_intel.4.epp=100 1> /dev/null 2> /dev/null | |
26 | + | doas sysctl dev.hwpstate_intel.5.epp=100 1> /dev/null 2> /dev/null | |
27 | + | doas sysctl dev.hwpstate_intel.6.epp=100 1> /dev/null 2> /dev/null | |
28 | + | doas sysctl dev.hwpstate_intel.7.epp=100 1> /dev/null 2> /dev/null | |
29 | + | #backlight 100 1> /dev/null 2> /dev/null | |
30 | + | backlight $(cat ${HOME}/.backlight-ac) 1> /dev/null 2> /dev/null | |
31 | + | ;; | |
32 | + | ||
33 | + | esac |
Newer
Older