git.lucas.co / cce-system-interface
system settings
git clone https://git.lucas.co/cce-system-interface.git

udev/90-cce-power-apply.rules (676B)

1 # Apply the cce Power page's per-source plan (/etc/cce/power.kdl) when the
2 # AC adapter appears at boot (coldplug add) or changes state. The kernel
3 # emits a change event for the Mains supply on plug and unplug, and usually
4 # on resume when the state differs from before suspend -- but not reliably,
5 # so cce-power-apply-resume.service re-applies after every wake as well.
6 # Through systemd rather than a direct RUN so nvidia-smi's few seconds never
7 # block udev.
8 # Installed to /etc/udev/rules.d by `ccebuild install-system`.
9 SUBSYSTEM=="power_supply", ACTION=="add|change", ENV{POWER_SUPPLY_TYPE}=="Mains", RUN+="/usr/bin/systemctl --no-block start cce-power-apply.service"