Laptop optimization
This ensures your laptop stays awake with the lid closed, maintains a stable network connection and boots quickly by ignoring unused network interfaces.
-
Lid and sleep configuration
Section titled “Lid and sleep configuration”These steps prevent the system from suspending or shutting down when the lid is closed or the power button is pressed.
-
Open logind config
Section titled “Open logind config”Terminal window sudo nano /etc/systemd/logind.conf -
Update config
Section titled “Update config”Update the following lines to
ignoreto keep the system awake./etc/systemd/logind.conf HandleSuspendKey=ignoreHandleLidSwitch=ignoreHandleLidSwitchExternalPower=ignoreHandleLidSwitchDocked=ignore -
Restart logind
Section titled “Restart logind”Terminal window sudo systemctl restart systemd-logind
-
-
Disable system-wide sleep
Section titled “Disable system-wide sleep”To prevent the kernel from attempting to sleep even if triggered by software, create a “no-sleep” override.
-
Create nosuspend config
Section titled “Create nosuspend config”Terminal window sudo mkdir -p /etc/systemd/sleep.conf.d/ && sudo nano /etc/systemd/sleep.conf.d/nosuspend.conf -
Add config
Section titled “Add config”/etc/systemd/sleep.conf.d/nosuspend.conf [Sleep]AllowSuspend=noAllowHibernation=noAllowSuspendThenHibernate=noAllowHybridSleep=no -
Reload daemon
Section titled “Reload daemon”Terminal window sudo systemctl daemon-reload
-