Score:3

How do you disable the Laptop Lid Switch in Ubuntu 20.04?

cn flag

Is there a way to just stop the OS from using the Laptop Lid Switch all together, regardless of what you want to happen?

If not, I want to close the lid and open it with out having to log back in.

ChanganAuto avatar
us flag
Selecting to do nothing has the exact some effect of "disabling" it which I'm not sure can be done.
OldMan avatar
cn flag
I didn't want to physically pull the switch out... but...
ChanganAuto avatar
us flag
Ubuntu release/version? Answers depend on it. The tool/app or settings to access is different depending on the Ubuntu flavor.
C.S.Cameron avatar
cn flag
@Nmath That is a ten year old question with twenty five answers, (some have been deleted), Which answer would you recommend that the OP try first?
muru avatar
us flag
The one that says 13.04-21.04, presumably.
Score:5
id flag

This is taken from a previous answer and it works: How can I tell Ubuntu to do nothing when I close my laptop lid?

In summary:

  1. Put this into the terminal:

    sudo -H gedit /etc/systemd/logind.conf
    
  2. Find the line that says:

    #HandleLidSwitchDocked=ignore
    
  3. Remove the # at the beginning (i.e. uncomment it), and save the file.

  4. Then type:

    sudo systemctl restart systemd-logind
    

When it restarts, you should find that shutting the lid turns the screen off, but leaves you logged in.

I hope that helps.

Nmath avatar
ng flag
It's better to close the question as a duplicate since the question and answer are exactly the same. By answering duplicate questions that have already been asked and answered elsewhere, it makes our site more difficult to navigate. For example, if future visitors search Ask Ubuntu for the answer to this question, it would be a disservice for them to land on this question, since it does not contain as much information. Even in the case of someone finding both questions, having information spread among multiple identical questions makes the information hard to access.
Will avatar
id flag
Thanks - and apologies for any disservice - completely unintentional and understood. I’d have preferred to put a comment in referencing the previous answer but can’t comment as yet so thought an answer with the link was the best I could do. Please feel free to convert my answer to a comment if that is better for the site.
C.S.Cameron avatar
cn flag
@Will: In my opinion offering the OP a specific answer to their question is better than referring them to a ten year old question with 25 different answers and no hint on which to try first. **You now have a high enough reputation to comment anywhere**.
OldMan avatar
cn flag
Thank you Will. So many answers for non 21.04 version, I had to remove the # . THANKS! Issue Resolved.
Will avatar
id flag
@OldMan - you’re vert welcome, pleased I could help. I guess you do need to be mindful that your battery will run down faster when you shut the lid than it would have done. C.S.Cameron - thank you for that. The different views on this site is one of the reasons I think it works so well. I think I might pop a question on meta on the subject of how to answer questions when there’s a very old answer/answers!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.