mirror of
https://github.com/rwinkhart/artix-install-script.git
synced 2026-09-05 08:27:16 -04:00
Set screen brightness at boot on g14
This commit is contained in:
@@ -1,8 +1,9 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# this bashpower script is intended for ASUS gaming laptops, 2020-2022
|
# this bashpower script is intended for ASUS gaming laptops, 2020-2022
|
||||||
# it has been tested on the 2020 Zephyrus G14 (GA401IV)
|
# it has only been tested on the 2020 Zephyrus G14 (GA401IV)
|
||||||
# kernel 5.17+ is required for full functionality
|
# kernel 5.17+ is required for full functionality
|
||||||
# place in /etc/local.d and use in conjunction with OpenRC for best results
|
# place in /etc/local.d/ and use in conjunction with OpenRC for best results
|
||||||
|
# be sure to add the "local" service to the default runlevel for this script to function
|
||||||
|
|
||||||
# create config directory and set default settings
|
# create config directory and set default settings
|
||||||
mkdir -p /usr/local/bashpower
|
mkdir -p /usr/local/bashpower
|
||||||
@@ -15,11 +16,15 @@ fi
|
|||||||
if [ ! -f /usr/local/bashpower/fan_curve ] ; then
|
if [ ! -f /usr/local/bashpower/fan_curve ] ; then
|
||||||
echo '20:0 30:0 40:0 50:30 60:50 70:70 85:100 90:100' > /usr/local/bashpower/fan_curve
|
echo '20:0 30:0 40:0 50:30 60:50 70:70 85:100 90:100' > /usr/local/bashpower/fan_curve
|
||||||
fi
|
fi
|
||||||
|
if [ ! -f /usr/local/bashpower/screen_brightness ] ; then
|
||||||
|
echo 50 > /usr/local/bashpower/screen_brightness
|
||||||
|
fi
|
||||||
|
|
||||||
# import user settings
|
# import user settings
|
||||||
governor=$(< /usr/local/bashpower/governor)
|
governor=$(< /usr/local/bashpower/governor)
|
||||||
batt_limit=$(< /usr/local/bashpower/batt_limit)
|
batt_limit=$(< /usr/local/bashpower/batt_limit)
|
||||||
fan_curve=$(< /usr/local/bashpower/fan_curve)
|
fan_curve=$(< /usr/local/bashpower/fan_curve)
|
||||||
|
screen_brightness=$(< /usr/local/bashpower/screen_brightness)
|
||||||
|
|
||||||
## on run:
|
## on run:
|
||||||
|
|
||||||
@@ -31,6 +36,9 @@ done
|
|||||||
# set keyboard backlight to off
|
# set keyboard backlight to off
|
||||||
echo 0 > /sys/class/leds/asus::kbd_backlight/brightness
|
echo 0 > /sys/class/leds/asus::kbd_backlight/brightness
|
||||||
|
|
||||||
|
# set screen brightness
|
||||||
|
echo $screen_brightness > /sys/class/backlight/amdgpu_bl0/brightness
|
||||||
|
|
||||||
# set battery charge limit
|
# set battery charge limit
|
||||||
echo "$batt_limit" > /sys/class/power_supply/BAT0/charge_control_end_threshold
|
echo "$batt_limit" > /sys/class/power_supply/BAT0/charge_control_end_threshold
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user