User Tools

Site Tools


notes:laptop_power_management

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
notes:laptop_power_management [2019/11/30 22:27] Sean Rhonenotes:laptop_power_management [2024/08/13 18:45] (current) – removed Sean Rhone
Line 1: Line 1:
-====== Laptop Power Management ====== 
  
-===== Notes ===== 
- 
-  * This expects a laptop with a battery 
-  * Do not use this for desktops 
- 
-===== Testing ===== 
- 
-  * The following commands can be ran to see if they work on specific hardware 
- 
-  watch -n 0.1 grep \'cpu MHz\' '/proc/cpuinfo' 
- 
-  sudo x86_energy_perf_policy --all 'performance' --turbo-enable '1' --force 
- 
-  sudo x86_energy_perf_policy --all 'power' --turbo-enable '0' --force 
- 
-====== Dependencies ====== 
- 
-===== Fedora Workstation ===== 
- 
-  * ''kernel-tools'' provides ''x86_energy_perf_policy'' 
- 
-  sudo dnf install 'kernel-tools' 
- 
-===== Ubuntu ===== 
- 
-  * ''linux-tools-common'' provides ''x86_energy_perf_policy'', and ''linux-tools-generic'' provides the module for it to actually work 
- 
-  linux-tools-common linux-tools-generic 
- 
-====== Scripts ====== 
- 
-===== AC ===== 
- 
-  * Change the ''backlight'' sysfs as-needed (see [[#backlight1|backlight notes]]) or remove altogether 
- 
-  sudo mkdir -p '/etc/udev/scripts.d' && sudo -e '/etc/udev/scripts.d/ac-power.sh' && sudo chmod +x '/etc/udev/scripts.d/ac-power.sh' 
- 
-<code> 
-#!/usr/bin/bash 
-# AC 
-echo "$(cat '/sys/class/backlight/'*'/max_brightness')" | tee '/sys/class/backlight/'*'/brightness' > '/dev/null' 
-x86_energy_perf_policy --all 'performance' --turbo-enable '1' --force 
-# End</code> 
- 
-===== Battery ===== 
- 
-  * Change the ''backlight'' sysfs as-needed (see [[distros:fedora_workstation_gnome#backlight|Backlight notes]]) or remove altogether 
- 
-  sudo mkdir -p '/etc/udev/scripts.d' && sudo -e '/etc/udev/scripts.d/battery-power.sh' && sudo chmod +x '/etc/udev/scripts.d/battery-power.sh' 
- 
-<code> 
-#!/usr/bin/bash 
-# Battery 
-echo '60600' | tee '/sys/class/backlight/'*'/brightness' > '/dev/null' 
-x86_energy_perf_policy --all 'power' --turbo-enable '0' --force 
-# End</code> 
- 
-===== udev Rule ===== 
- 
-  * Requires the above AC and Battery scripts 
- 
-  sudo -e '/etc/udev/rules.d/99-power.rules' && sudo udevadm control --reload 
- 
-<code> 
-SUBSYSTEM=="power_supply", ATTR{online}=="1", RUN+="/etc/udev/scripts.d/ac-power.sh" 
-SUBSYSTEM=="power_supply", ATTR{online}=="0", RUN+="/etc/udev/scripts.d/battery-power.sh"</code> 
C:/www/wiki/data/attic/notes/laptop_power_management.1575170843.txt.gz · Last modified: (external edit)