Gnome-Shell Extension for controlling the frequency setting of your CPU
Prerequisites •
Installation •
Translating •
Packaging •
Developing
This is a semi-"mainained" version of the original cpupower
repo made by Nicolas Derumigny, compatible with GNOME 45. I do it on my free time and for my own configuration only. I accept PRs and bug reports, but do not expect me to fix it quick.
--- original, NOT UPDATED README ----
You need to have a CPU which is supported by the cpufreq or intel_pstate CPU frequency scaling driver of the Linux kernel. This applies for most modern CPU's. Furthermore, the following software needs to be installed to use this extension:
- Gnome (since it's an extension)
- Policykit (ships default with gnome)
- For Intel Core CPU's
intel_pstate
needs to be enabled in the Linux kernel (should be the default in almost all Distros) - For AMD Ryzen CPU's no further requirements are needed
- A POSIX compatible shell
Installing this extension can either be done via distribution packages provided by us (recommended) or via the Gnome extensions website (often outdated). Have a look at the options below to find the correct installation method for your system.
Info: The
$
at the beginning of a line means that this line should be run as the user who is using the extension (most likely you). If you don't know what that means, just open up a terminal and use it as is. Commands are run as your user by default. So for the line$ echo Hello world
you would typeecho Hello world
into your terminal and hit enter.
Info: The
#
at the beginning of a line means that this line must be run withroot
privileges (the name of the administrator account on Linux systems). So for the line# dnf update
you would then e.g. runsudo dnf update
in your terminal if your system usessudo
. Your system is most likely usingsudo
and if not you would know it.
click to expand
To install the extension on any newer Ubuntu based system (e.g. PopOS) run the below commands.
WARNING: This will not work for ElementaryOS, Linux Mint, and any other Ubuntu which is not using the GNOME desktop environment. Running the below commands will likely break your system otherwise!
Info: It is safe to install this extension if only a single package is installed by the below
apt-get install
command. If more packages are to be installed, please stop doing so and if unsure create an issue asking for help!
$ sudo add-apt-repository ppa:fin1ger/cpupower
$ sudo apt-get update
$ sudo apt-get install gnome-shell-extension-cpupower
Now log out and back in again. Yes, this is really necessary thanks to Gnome. After logging back in, enable the extension with:
$ gnome-extensions enable [email protected]
The extension should now be enabled and ready to use!
click to expand
To install this extension on Ubuntu Bionic Beaver please run the following commands:
$ sudo add-apt-repository ppa:fin1ger/cpupower
$ sudo apt-get update
$ sudo apt-get install gnome-shell-extension-cpupower
Now log out and back in again. Yes, this is really necessary thanks to Gnome. After logging back in, enable the extension with:
$ gnome-shell-extension-tool -e [email protected]
The extension should now be enabled and ready to use!
click to expand
To install the extension on any newer Debian based system run the below commands.
WARNING: This will not work when using any desktop environment other than GNOME. Running the below commands while using other desktop environments will likely break your system!
Info: It is safe to install this extension if only a single package is installed by the below
apt-get install
command. If more packages are to be installed, please stop doing so and if unsure create an issue asking for help!
# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D76A018A2B4E77F5
# add-apt-repository 'deb http://ppa.launchpad.net/fin1ger/cpupower/ubuntu hirsute main'
# apt-get update
# apt-get install gnome-shell-extension-cpupower
Note: Debian is not using
sudo
by default. If you do not havesudo
, get aroot
shell by typingsu
in a terminal and entering your superuser password.
Now log out and back in again. Yes, this is really necessary thanks to Gnome. After logging back in, enable the extension with:
$ gnome-extensions enable [email protected]
The extension should now be enabled and ready to use!
click to expand
To install this extension on most RPM based Linux distributions run the below commands.
WARNING: This will not work when using any desktop environment other than GNOME. Running the below commands while using other desktop environments will likely break your system!
Info: It is safe to install this extension if only a single package is installed by the below
dnf install
command. If more packages are to be installed, please stop doing so and if unsure create an issue asking for help!
# dnf copr enable fin-ger/cpupower
# dnf install gnome-shell-extension-cpupower
You need to have the package
dnf-plugins-core
installed. If the above commands are failing try installing them withdnf install dnf-plugins-core
and rerun the above commands.
Caution: Due to a name change required by the Fedora admins of my Fedora account, the name of the copr also changed.
fin_ger/cpupower
has changed tofin-ger/cpupower
.
Now log out and back in again. Yes, this is really necessary thanks to Gnome. After logging back in, enable the extension with:
$ gnome-extensions enable [email protected]
The extension should now be enabled and ready to use!
click to expand
Download the appropriate .repo
file for your OpenSUSE release (most likely the latest version) and save it to /etc/zypp/repos.d/
. Now run the following commands:
# zypper install gnome-shell-extension-cpupower
Now log out and back in again. Yes, this is really necessary thanks to Gnome. After logging back in, enable the extension with:
$ gnome-extensions enable [email protected]
The extension should now be enabled and ready to use!
click to expand
Open the cpupower
Gnome extensions website in your default webbrowser. Click on the blue slider to install the extension.
After installation, click on the CPU icon in the top bar of your Gnome shell and follow the instructions. You need to enter your root password to install a policy kit rule. This rule is used to set the clock frequency of your CPU.
You are now ready to use this extension!
click to expand
Fear not! We have other options for installing this extension. Although, you will not receive automatic updates which might be dangerous if we encounter security issues in the extension and you miss the fix for that issue. If you regularly check for updates yourself you can of course still use this extension without any risk.
If your distribution is capable of installing DEB
or RPM
packages, have a look at the releases page of this repository for downloadable pre-built packages.
Another option is to install the extension zip file manually. To do so, download the latest zip
from the release page. Now run the following commands:
$ gnome-extensions install /path/to/cpupower.zip
Now log out and back in again. Yes, this is really necessary thanks to Gnome. After logging back in, enable the extension with:
$ gnome-extensions enable [email protected]
After enabling, click on the CPU icon in the top bar of your Gnome shell and follow the instructions. You need to enter your root password to install a policy kit rule. This rule is used to set the clock frequency of your CPU.
You are now ready to use this extension!
You are a developer or sysadmin and are looking for ways to install this extension directly from the git repository? Read on! The section below will explain in detail how to do so.
In order to use the Makefile you need the following packages:
- make
- gettext
- glib2 tools
- zip and unzip
- tar
Impersonate the (admin) user, clone the git repository, and run the following command:
Note: Cloning and installing the extension while impersonating the other user, enables this user to install updates for this extension from extensions.gnome.org.
$ sudo -u username bash
$ cd /tmp
$ git clone https://github.com/deinstapel/cpupower.git
$ cd cpupower
$ make install PREFIX=/home/username/.local
Restart the gnome-shell (log out and back in) to make the extension available.
The user can enable the extension in his settings and install the polkit rule and cpufreqctl
tool by using the included installation guide.
The user can uninstall the tools in the settings of this extension. The extension itself can be removed from withing the extension settings or with this command:
$ make uninstall PREFIX=/home/username/.local
Impersonate the (non-admin) user, clone the git repository, and run the following command:
Note: Cloning and installing the extension while impersonating the other user, enables this user to install updates for this extension from extensions.gnome.org. However, the tool must be updated and installed by an administrator. The extension may stop working after the user installed an update and may need updating of the tool by an administrator.
$ sudo -u username bash
$ cd /tmp
$ git clone https://github.com/deinstapel/cpupower.git
$ cd cpupower
$ make install PREFIX=/home/username/.local
And with an admin user run the following commands:
$ sudo make install-tool TOOL_SUFFIX=username
Note: Also, use this command to update the tool for another user in an outdated installation.
Note: Using another PREFIX than
/usr
in this setup might include security risks and may not work.
Restart the gnome-shell (log out and back in) to make the extension available.
The extension will work out-of-the-box for this user only!
$ sudo make uninstall PREFIX=/home/username/.local
$ sudo make uninstall-tool TOOL_SUFFIX=username
Clone the git repository and run the following command:
$ sudo make install install-tool
This will install the extensions, polkit rule, and the tool for all users on the system.
Run the following command to uninstall:
$ sudo make uninstall uninstall-tool
cpupower
now uses crowdin for translation. You are free to choose from manually translating this extension with tools like Poedit
or using the online service of crowdin.
First visit the project page of cpupower
on crowdin and select the language you would like to translate to. Now, click on Translate All
and you're good to go.
In order to translate this extension with Poedit
you first need to install it. You may use your distributions package manager for installation.
When finished, fork this project and clone like described in the linked guide.
Open Poedit and select File
/ New From POT/PO File...
and select cpupower/locale/template.pot
. Select the language you want to translate to. Now start translating.
Open Poedit and select Open
. Navigate to the cpupower/locale
folder and select the language file (.po
) you want to edit/update. Now select Catalog
/ Update from POT File...
and select cpupower/locale/template.pot
. Now, you can start updating the translation.
When finished save the file into the locale
folder and push your changes to your fork. Now, you can create a pull request to make your translation available in the main cpupower installation.
You are a package maintainer and looking into packaging this extension? Great! Below is a short summary of how to properly install this extension (run as root
):
# make install install-tool PREFIX=/usr
This will install a polkit rule to /usr/share/polkit-1/actions/mko.cpupower.setcpufreq.policy
and an executable bash script to /usr/bin/cpufreqctl
. The extension is installed to /usr/share/gnome-shell/extensions/[email protected]
. It still includes the scripts
folder, the policykit rule template in data/mko.cpupower.policy.in
, a useless copy of the tool in the tool
folder, and the Makefile
. These are included in the distribution of the extension to enable user installation if the extension got installed over the GNOME extensions website. If you do not want to distribute those files in your package, you can safely remove them.
If you find any issues in packaging this extension, please don't hesitate to report them!
Clone the repository and run:
$ make install PREFIX=/home/username/.local
and reload the extension by restarting your gnome-shell.
Clone the respository to ~/.local/share/gnome-shell/extensions/[email protected]
and reload the extension by restarting your gnome-shell.
You can now enable the extension in your extension settings.
$ journalctl /usr/bin/gnome-shell -f
Only core contributors to this project can make a new release. To create one, run:
$ make release