aboutsummaryrefslogtreecommitdiff
path: root/articles/2025/Closing-laptop-lid-without-suspend.html
blob: 5890d25777ef0d586980dba8ceee19d9f79be3bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!doctype html>
<html lang="EN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="/style.css">
    <title>Closing laptop lid without suspend</title>
  </head>
  <body>
    <header>
      <h1>Bloggings</h1>
      <a href="/index.php">Back</a>
      
    </header>
    
<main>
<article>
<h2>Closing laptop lid without suspend</h2>
<h3>2025-07-04</h3>
<h4>Looking into using a laptop as a home server</h4>
<p>Since I've got a fibre connection I've been musing about not paying for a VPS and using a home server instead.</p>
<p>I have an unused laptop that could fit the bill maybe. The advantage of a laptop is that 1) I have one and 2) No need for 
a ups or screen.</p>
<p>I'm not really sure that I'll build a home server like this, but I'm collecting info.</p> 
<p>One of the things I was wondering is how to stop a laptop from entering suspend when the lid is closed. I found a 
comment on unixstackexchange that explains how to do it on a non-systemd installation. (and a systemd one too but who cares about that?)</p>
<p>Find the path of the lid switch:</p>
<code>cat /proc/acpi/wakeup</code>
<p>Find the line for the lid and enter the command to deactivate it, for example:</p>
<code>echo 'PNP0C0D:00' | sudo tee /sys/bus/acpi/drivers/button/unbind</code>
<p>If it works, you can add the above line to /etc/rc.local to make it permanent.</p> 
<p><a href="https://unix.stackexchange.com/questions/706471/linux-cli-disable-sleep-when-laptop-lid-closed">Original comment</a></p>
<p>On systemd installations, edit /etc/systemd/logind.conf and uncomment the following line: HandleLidSwitch=ignore.</p>

    </article>
</main>
<footer>

    <p>&nbsp;</p>
    
    <p>§</p>
  </footer>
</body>
</html>