How to disable [root] password asking on each CPU frequency scaling change?

Created by Ivan Zorin
Keywords:
battery-status cpufreq PolicyKit
Last updated by:
Ivan Zorin

Q: In some environments/distributions user must input [root] password for changing CPU frequency scaling.
And in some cases (if computer has a couple CPUs) user must input password for each CPU.
How to disable asking password?

A: If your distro use PolicyKit, then open terminal, and run:
# gedit /var/lib/polkit-1/localauthority/50-local.d/org.gnome.cpufreqselector.pkla
Paste this text block in file:

[org.gnome.cpufreqselector]
Identity=unix-user:put_your_login_name_here
Action=org.gnome.cpufreqselector
ResultAny=no
ResultInactive=no
ResultActive=yes

and save it. Your login name you can get by running command:
$ whoami