Arch Linux Laptop Tweaks Guide
This guide helps improve laptop performance, battery life, and usability on Arch Linux.
1. Prevent Sleep When Lid is Closed
To keep your laptop running with the lid closed, modify systemd's configuration.
Open a terminal and run:
bashsudo tee -a /etc/systemd/logind.conf << EOF HandleSuspendKey=ignore HandleSuspendKeyLongPress=ignore HandleHibernateKey=ignore HandleHibernateKeyLongPress=ignore HandleLidSwitch=ignore HandleLidSwitchExternalPower=ignore HandleLidSwitchDocked=ignore EOF
Reload the systemd config:
bashsudo systemctl restart systemd-logind
2. Battery Optimization
WARNING
Using both tlp
and auto-cpufreq
together will cause compatibility issues. It is recommended to use one power management tool at a time to avoid conflicts in settings and performance optimization.
2.1. auto-cpufreq (CPU Power Scaling) (Recommended)
auto-cpufreq
adjusts CPU frequency and power settings based on system load and battery status, optimizing performance and energy use.
Install
auto-cpufreq
(requires an AUR helper likeyay
):bashyay -S auto-cpufreq
Test in live mode (observe real-time adjustments without installation):
bashsudo auto-cpufreq --live
Enable automatic startup (run at boot for automatic adjustments):
bashsudo auto-cpufreq --install
Monitor system over time (observe system behavior without making changes):
bashsudo auto-cpufreq --monitor
View CPU statistics:
bashsudo auto-cpufreq --stats
Uninstall the service:
bashsudo auto-cpufreq --remove
2.2. TLP (Advanced Power Management)
TLP optimizes battery life automatically.
Install TLP:
bashsudo pacman -S tlp tlp-rdw
Start and enable the service:
bashsudo systemctl enable tlp --now
Check TLP status:
bashsudo tlp-stat
Optional: For a GUI, install
tlpui
(requires AUR helper likeyay
):bashyay -S tlpui
Run
tlpui
to configure TLP with a graphical interface.
2.3. CPU Scaling Governor
Optimize your CPU governor to balance performance and power usage, especially on battery-powered devices.
Install Dependencies:
bashsudo pacman -S cpupower
View Current CPU Governor:
bashcpupower frequency-info
Or use:
bashcat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
Set the CPU Governor:
To set the governor to
schedutil
(recommended for modern kernels):bashsudo cpupower frequency-set -g schedutil
For maximum battery efficiency, use the
powersave
governor:bashsudo cpupower frequency-set -g powersave
Make the Governor Setting Persistent:
Open the
cpupower
configuration file for editing:bashsudo nano /etc/default/cpupower
Add or edit the following line:
bashGOVERNOR="schedutil" # or "powersave"
Enable and Start the
cpupower
Service:bashsudo systemctl enable cpupower --now
Verify the Governor Setting:
bashcpupower frequency-info
3. Adjust Swap Usage (Swappiness)
Reduce swap usage to improve performance.
Check current swappiness (Default = 60):
bashcat /proc/sys/vm/swappiness
Edit the config file:
bashsudo nano /etc/sysctl.conf
Set swappiness to 10 for less aggressive swap usage:
bashvm.swappiness=10
Apply changes:
bashsudo sysctl -p
4. File System Performance (noatime)
Disable file access time writes for better performance, especially on SSDs.
Edit
/etc/fstab
:bashsudo nano /etc/fstab
Add
noatime
to your root (/
) partition options:bashUUID=<your-disk-UUID> / ext4 defaults,noatime 0 1
Reboot to apply the change.
5. System Monitoring Tools
5.1. powertop (Power Consumption Monitor)
Monitor and optimize power usage.
Install
powertop
:bashsudo pacman -S powertop
Run in interactive mode:
bashsudo powertop
Optimize settings automatically:
bashsudo powertop --auto-tune
5.2. btop or htop (Resource Monitoring)
Monitor CPU, memory, and system resources.
Install
btop
:bashsudo pacman -S btop
Install
htop
:bashsudo pacman -S htop