Skip to content

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.


  1. These steps prevent the system from suspending or shutting down when the lid is closed or the power button is pressed.

    1. Terminal window
      sudo nano /etc/systemd/logind.conf
    2. Update the following lines to ignore to keep the system awake.

      /etc/systemd/logind.conf
      HandleSuspendKey=ignore
      HandleLidSwitch=ignore
      HandleLidSwitchExternalPower=ignore
      HandleLidSwitchDocked=ignore
    3. Terminal window
      sudo systemctl restart systemd-logind
  2. To prevent the kernel from attempting to sleep even if triggered by software, create a “no-sleep” override.

    1. Terminal window
      sudo mkdir -p /etc/systemd/sleep.conf.d/ && sudo nano /etc/systemd/sleep.conf.d/nosuspend.conf
    2. /etc/systemd/sleep.conf.d/nosuspend.conf
      [Sleep]
      AllowSuspend=no
      AllowHibernation=no
      AllowSuspendThenHibernate=no
      AllowHybridSleep=no
    3. Terminal window
      sudo systemctl daemon-reload