Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

askthedev.com Logo askthedev.com Logo
Sign InSign Up

askthedev.com

Search
Ask A Question

Mobile menu

Close
Ask A Question
  • Ubuntu
  • Python
  • JavaScript
  • Linux
  • Git
  • Windows
  • HTML
  • SQL
  • AWS
  • Docker
  • Kubernetes
Home/ Questions/Q 14273
Next
In Process

askthedev.com Latest Questions

Asked: September 27, 20242024-09-27T01:47:35+05:30 2024-09-27T01:47:35+05:30In: Ubuntu

How can I configure my Ubuntu system to remain inactive when I close the lid of my laptop?

anonymous user

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!

  • 0
  • 0
  • 2 2 Answers
  • 0 Followers
  • 0
Share
  • Facebook

    Leave an answer
    Cancel reply

    You must login to add an answer.

    Continue with Google
    or use

    Forgot Password?

    Need An Account, Sign Up Here
    Continue with Google

    2 Answers

    • Voted
    • Oldest
    • Recent
    1. anonymous user
      2024-09-27T01:47:36+05:30Added an answer on September 27, 2024 at 1:47 am



      Ubuntu Lid Close Settings

      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:

      1. Go to the Settings app.
      2. Click on Power.
      3. Look for the option that says When the lid is closed.
      4. Change it to Do Nothing.

      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:

      1. Open your terminal (you can find it by searching for “Terminal” in the app list).
      2. Type this command to open the config file in a text editor (we’ll use nano for this example):
      3. sudo nano /etc/systemd/logind.conf
      4. Look for the lines that say #HandleLidSwitch=suspend, which is probably commented out.
      5. Change it to:
      6. HandleLidSwitch=ignore
      7. To save in nano, press Ctrl + O (then hit Enter to confirm), and to exit, press Ctrl + X.
      8. Finally, restart the logind service by typing:
      9. sudo systemctl restart systemd-logind

      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!


        • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    2. anonymous user
      2024-09-27T01:47:37+05:30Added an answer on September 27, 2024 at 1:47 am

      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, type sudo nano /etc/systemd/logind.conf and press Enter. 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 reads HandleLidSwitch=ignore. After making this change, save the file by pressing Ctrl + O, then Enter, and exit with Ctrl + X.

      Next, you need to restart the logind service to apply the changes. In the terminal, type sudo systemctl restart systemd-logind and hit Enter. 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!

        • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp

    Related Questions

    • I'm having trouble installing the NVIDIA Quadro M2000M driver on Ubuntu 24.04.1 LTS with the current kernel. Can anyone provide guidance or solutions to this issue?
    • What steps can I take to troubleshoot high usage of GNOME Shell in Ubuntu 24.04?
    • I recently performed a fresh installation of Ubuntu 24.04, and I've noticed that my RAM usage steadily increases over time until my system becomes unresponsive. Has anyone experienced this issue ...
    • How can I resolve the "unknown filesystem" error that leads me to the GRUB rescue prompt on my Ubuntu system?
    • I'm experiencing an issue with Ubuntu 24.04 where Nautilus fails to display the progress indicator when I'm copying large files or folders. Has anyone else encountered this problem, and what ...

    Sidebar

    Related Questions

    • I'm having trouble installing the NVIDIA Quadro M2000M driver on Ubuntu 24.04.1 LTS with the current kernel. Can anyone provide guidance or solutions to this ...

    • What steps can I take to troubleshoot high usage of GNOME Shell in Ubuntu 24.04?

    • I recently performed a fresh installation of Ubuntu 24.04, and I've noticed that my RAM usage steadily increases over time until my system becomes unresponsive. ...

    • How can I resolve the "unknown filesystem" error that leads me to the GRUB rescue prompt on my Ubuntu system?

    • I'm experiencing an issue with Ubuntu 24.04 where Nautilus fails to display the progress indicator when I'm copying large files or folders. Has anyone else ...

    • How can I configure a server running Ubuntu to bind specific IP addresses to two different network interfaces? I'm looking for guidance on how to ...

    • Is it possible to configure automatic login on Ubuntu MATE 24.04?

    • After upgrading from Ubuntu Studio 22.04 to 24.04.1, I lost all audio functionality. What steps can I take to diagnose and resolve this issue?

    • I am experiencing issues booting Ubuntu 22.04 LTS from a live USB. Despite following the usual procedures, the system fails to start. What steps can ...

    • I'm encountering a problem with my Expandrive key while trying to update my Ubuntu system. Has anyone else faced similar issues, and if so, what ...

    Recent Answers

    1. anonymous user on How do games using Havok manage rollback netcode without corrupting internal state during save/load operations?
    2. anonymous user on How do games using Havok manage rollback netcode without corrupting internal state during save/load operations?
    3. anonymous user on How can I efficiently determine line of sight between points in various 3D grid geometries without surface intersection?
    4. anonymous user on How can I efficiently determine line of sight between points in various 3D grid geometries without surface intersection?
    5. anonymous user on How can I update the server about my hotbar changes in a FabricMC mod?
    • Home
    • Learn Something
    • Ask a Question
    • Answer Unanswered Questions
    • Privacy Policy
    • Terms & Conditions

    © askthedev ❤️ All Rights Reserved

    Explore

    • Ubuntu
    • Python
    • JavaScript
    • Linux
    • Git
    • Windows
    • HTML
    • SQL
    • AWS
    • Docker
    • Kubernetes

    Insert/edit link

    Enter the destination URL

    Or link to existing content

      No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.