Powertop
Set Tunables On Startup
Problem: The powertop --auto-tune tool aggressively suspends USB ports after system startup, causing the mouse and keyboard to freeze or disconnect.
Solution: Modifying the Powertop systemd service – after performing the auto-tune, specific USB ports are forced to stay permanently on.
⚠️ Note: This solution is tied to specific physical USB ports. If you plug the mouse or keyboard into a different USB port, you must update the paths in the configuration.
Steps
1. Opening the service configuration
Run the command in the terminal to edit the Powertop systemd configuration:
sudo systemctl edit --full powertop.service
2. Modifying the configuration file
In the open editor, find the [Service] section and add the following two ExecStartPost lines below the line starting with ExecStart=:
[Service]
# Original line (leave as is):
ExecStart=/usr/bin/powertop --auto-tune
# Added lines to force power on:
ExecStartPost=/bin/sh -c "echo 'on' > '/sys/bus/usb/devices/5-2.3/power/control'"
ExecStartPost=/bin/sh -c "echo 'on' > '/sys/bus/usb/devices/5-2.2/power/control'"
sudo systemctl restart powertop.service