Skip to content

Instantly share code, notes, and snippets.

@JamesAtIntegratnIO
Created March 13, 2023 16:37
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JamesAtIntegratnIO/469c7e421e983ac26befca0fe5349026 to your computer and use it in GitHub Desktop.
Save JamesAtIntegratnIO/469c7e421e983ac26befca0fe5349026 to your computer and use it in GitHub Desktop.
udev rules for power profile switching for laptops
services.udev.extraRules = ''
SUBSYSTEM=="power_supply",ENV{POWER_SUPPLY_ONLINE}=="0",RUN+="${pkgs.power-profiles-daemon}/bin/powerprofilesctl set power-saver"
SUBSYSTEM=="power_supply",ENV{POWER_SUPPLY_ONLINE}=="1",RUN+="${pkgs.power-profiles-daemon}/bin/powerprofilesctl set performance"
'';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment