I’ve been having this annoying issue with my Ubuntu laptop lately, and I really need some help. So, here’s the deal: every time I close the lid of my laptop, it just goes to sleep or hibernates, and it’s driving me crazy! I mean, I get that it’s probably some default setting or something, but it’s not what I want at all.
I tend to pop the lid down for a minute while I’m working, either to quickly grab a snack or take a quick call, and I don’t want to deal with the hassle of waiting for it to boot back up again. I’ve tried to dig around in the settings myself, but honestly, I’m kind of lost. I found some options under Power settings, but nothing seems to stick.
I really want to configure my Ubuntu system so that it remains completely inactive when I close the lid. It would be super convenient for me, and I think it would save me a lot of time and frustration in the long run. I’m not a complete noob when it comes to tech, but I might need a bit of hand-holding here.
I’ve searched online and found a couple of potential solutions, like messing around with the ‘Logind.conf’ file in the system or using the terminal, but I’m kind of hesitant to try that because I don’t want to mess anything up. If anyone could walk me through the process or share some tips on how I can get my laptop to stay awake when I close the lid, I would seriously appreciate it!
Also, if there are any differences based on the version of Ubuntu (I’m currently using 20.04), that would be good to know too. Anyone else dealt with this issue? What worked for you? I’m all ears!
How to Stop Ubuntu from Sleeping When You Close the Lid
Hey! I totally get your pain with the laptop going to sleep when you close the lid. It can be super annoying when you just want to quickly step away and not wait forever for it to wake up again. Let’s sort this out together!
Step 1: Check Power Settings
You mentioned looking in the Power settings, but let’s double-check just in case:
Sometimes these settings don’t stick, so if it doesn’t work, let’s try editing the config file.
Step 2: Editing Logind.conf
This part sounds a bit scary, but it’s pretty straightforward. Here’s what you need to do:
#HandleLidSwitch=suspend
, which is probably commented out.And that’s it! Your laptop should now just chill when you close the lid.
Final Tips
If you’re still having issues, it could be related to different versions of Ubuntu. However, this method works pretty well with Ubuntu 20.04. Just remember to keep an eye on the settings if you update your system in the future!
Good luck, and feel free to reach out if you run into any snags!
To prevent your Ubuntu laptop from sleeping or hibernating when you close the lid, you can modify the settings in the ‘Logind.conf’ file. First, you need to open a terminal window. You can do this by pressing
Ctrl + Alt + T
. Once the terminal is open, typesudo nano /etc/systemd/logind.conf
and pressEnter
. You may be prompted to enter your password. In the file, look for the line that says#HandleLidSwitch=suspend
. You will need to uncomment this line by removing the ‘#’ at the beginning and change the ‘suspend’ to ‘ignore’, so it readsHandleLidSwitch=ignore
. After making this change, save the file by pressingCtrl + O
, thenEnter
, and exit withCtrl + X
.Next, you need to restart the logind service to apply the changes. In the terminal, type
sudo systemctl restart systemd-logind
and hitEnter
. This will apply your new settings without needing to restart your laptop. As for potential differences in versions of Ubuntu, the steps provided should work similarly across recent versions, including Ubuntu 20.04. Just ensure you have the necessary permissions to edit system files, and you should be good to go. If you encounter any issues, feel free to ask for more help!