PowerSaver
is a Bash script that manages CPU frequency and performance profiles for Linux systems using cpupower
. It allows users to dynamically set CPU frequency limits and governors based on predefined user and CPU profiles, optimizing for performance or power savings.
- View CPU Info: Displays the CPU model, core count, and current frequency limits.
- Predefined Profiles:
- User Profiles: Fire, Work, Relax, Out of Office (OOO), Time Is Gold.
- CPU Profiles: Max, Minus One GHz, Half, Min, Custom (frequency and unit).
- Governors: Automatically sets
powersave
orperformance
governors for each profile. - Custom Limits: Supports custom frequency settings in MHz or GHz.
- cpupower: Ensure that
cpupower
is installed:sudo apt install cpupower
./powersaver.sh [options]
-
--user-profile [ fire | work | relax | ooo | timeisgold ]
- Fire: Max performance with high frequency and performance governor.
- Work: High performance with moderate frequency and performance governor.
- Relax: Moderate performance with lower power consumption.
- OOO: Energy-saving profile with low frequency and powersave governor.
- Time Is Gold: Minimal performance, powersave governor, and lowest frequency.
-
--cpu-profile [ max | minusgiga | half | min | custom [max_freq] [Mhz|GHz] ]
- max: Set CPU to its maximum frequency.
- minusgiga: Set CPU to one GHz below the maximum.
- half: Set CPU to half of its maximum frequency.
- min: Set CPU to its minimum frequency.
- custom [max_freq] [Mhz|GHz]: Set a custom maximum frequency.
-
--governor [ powersave | performance ]
- powersave: Set the CPU to energy-saving mode.
- performance: Set the CPU to high-performance mode.
# Set the user profile to 'work'
./powersaver.sh --user-profile work
# Set custom CPU profile with max frequency of 2.5 GHz and powersave governor
./powersaver.sh --cpu-profile custom 2.5 GHz --governor powersave
If no arguments are provided, the script will display the current CPU model, frequency limits, current frequency policy, and active governors:
./powersaver.sh
The script supports desktop notifications (using notify-send
) to indicate profile changes. Ensure your desktop environment supports notifications.
The Unlicence.