Skip to content

Instantly share code, notes, and snippets.

@yuri1969
Last active March 13, 2023 19:13
Show Gist options
  • Select an option

  • Save yuri1969/b1ec6fbfb48a5b501805e861fbfa9701 to your computer and use it in GitHub Desktop.

Select an option

Save yuri1969/b1ec6fbfb48a5b501805e861fbfa9701 to your computer and use it in GitHub Desktop.
udev A/C supply vs battery rules
# AC plugged in
SUBSYSTEM=="power_supply", KERNEL=="AC", ATTR{online}=="1", RUN+="/bin/sh -c 'echo \'performance\' | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor'"
# AC plugged out
SUBSYSTEM=="power_supply", KERNEL=="AC", ATTR{online}=="0", RUN+="/bin/sh -c 'echo \'powersave\' | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment