Managing FastAPI Projects with Poetry: A Step-by-Step Guide

By default, Ubuntu suspends your laptop when you close the lid. However, in some use cases, such as downloading files overnight, using external displays, or running services, you may want your laptop to stay awake. Here’s how to configure your system so it continues running even with the lid closed.
logind.conf
FileOpen a terminal and run the following command to edit the systemd logind configuration file:
sudo vi /etc/systemd/logind.conf
Find the following lines (they may be commented out) and modify them as shown below:
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore
If any of these lines are commented out with #
, be sure to remove the comment symbol.
After saving the file, apply the changes by restarting the systemd-logind service:
sudo systemctl restart systemd-logind
Your Ubuntu laptop will now keep running even when the lid is closed. Just be cautious about heat buildup if you leave your laptop running in a closed space like a backpack.
Comments
Post a Comment