diff --git a/.config/scripts/udev.sh b/.config/scripts/udev.sh new file mode 100755 index 0000000..ce9f482 --- /dev/null +++ b/.config/scripts/udev.sh @@ -0,0 +1,19 @@ +#!/usr/bin/zsh + +performance() { + + echo '128' >/sys/class/leds/system76_acpi::kbd_backlight/brightness + /usr/bin/system76-power profile performance +} + +battery() { + + echo '128' >/sys/class/leds/system76_acpi::kbd_backlight/brightness + /usr/bin/system76-power profile battery +} + +case "$1" in +performance) performance ;; +battery) battery ;; +*) echo "Please enter an action" ;; +esac diff --git a/ansible/files/udev/61-onbattery.rules b/ansible/files/udev/61-onbattery.rules index d65f08b..a778b76 100644 --- a/ansible/files/udev/61-onbattery.rules +++ b/ansible/files/udev/61-onbattery.rules @@ -1,2 +1,2 @@ # Rule for when switching to battery -SUBSYSTEM=="power_supply",ENV{POWER_SUPPLY_ONLINE}=="0",RUN+="/usr/bin/system76-power profile battery" +SUBSYSTEM=="power_supply",ENV{POWER_SUPPLY_ONLINE}=="0",RUN+="/home/user/.config/scripts/udev.sh battery" diff --git a/ansible/files/udev/62-onpower.rules b/ansible/files/udev/62-onpower.rules index 871fc5d..e414729 100644 --- a/ansible/files/udev/62-onpower.rules +++ b/ansible/files/udev/62-onpower.rules @@ -1,2 +1,2 @@ # Rule for when switching to power supply -SUBSYSTEM=="power_supply",ENV{POWER_SUPPLY_ONLINE}=="1",RUN+="/usr/bin/system76-power profile performance" +SUBSYSTEM=="power_supply",ENV{POWER_SUPPLY_ONLINE}=="1",RUN+="/home/user/.config/scripts/udev.sh performance"