powersave-openbsd.sh
· 347 B · Bash
Raw
#! /bin/sh
#
# Author: Dominic Reich <quick.hat4396@qtztsjosmprqmgtunjyf.com>
case $( sysctl -n hw.power ) in
(0) # BATTERY
doas wsconsctl display.brightness=$(cat ${HOME}/.backlight-bat) 1> /dev/null 2> /dev/null
;;
(1) # AC
doas wsconsctl display.brightness=$(cat ${HOME}/.backlight-ac) 1> /dev/null 2> /dev/null
;;
esac
1 | #! /bin/sh |
2 | # |
3 | # Author: Dominic Reich <quick.hat4396@qtztsjosmprqmgtunjyf.com> |
4 | |
5 | case $( sysctl -n hw.power ) in |
6 | |
7 | (0) # BATTERY |
8 | doas wsconsctl display.brightness=$(cat ${HOME}/.backlight-bat) 1> /dev/null 2> /dev/null |
9 | ;; |
10 | |
11 | (1) # AC |
12 | doas wsconsctl display.brightness=$(cat ${HOME}/.backlight-ac) 1> /dev/null 2> /dev/null |
13 | ;; |
14 | |
15 | esac |
16 |