<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>i3 FAQ - Individual question feed</title><link>https://faq.i3wm.org/questions/</link><description>Frequently asked questions and answers about the i3 window manager</description><atom:link href="http://faq.i3wm.org/feeds/question/5629/" rel="self"></atom:link><language>en</language><copyright>Copyright i3, 2012</copyright><lastBuildDate>Fri, 20 Mar 2015 11:08:37 +0000</lastBuildDate><item><title>How to prevent sleep on laptop lid close?</title><link>https://faq.i3wm.org/question/5629/how-to-prevent-sleep-on-laptop-lid-close/</link><description>Sort of like an antithesis to [this question](https://faq.i3wm.org/question/828/suspend-on-lid-close-for-a-laptop-best-approaches/).

I'd like to know how to avoid my laptop from sleeping on lid close which seems to be the default functionality after a fresh install of i3.

In addition to that, how should I go about setting things to happen once the lid closes like lock and turn off the screen (and just the screen)?

I'm running Ubuntu 14.04.</description><pubDate>Wed, 18 Mar 2015 15:02:29 +0000</pubDate><guid>https://faq.i3wm.org/question/5629/how-to-prevent-sleep-on-laptop-lid-close/</guid></item><item><title>Comment by Adaephon for &lt;p&gt;Sort of like an antithesis to &lt;a href="https://faq.i3wm.org/question/828/suspend-on-lid-close-for-a-laptop-best-approaches/"&gt;this question&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I'd like to know how to avoid my laptop from sleeping on lid close which seems to be the default functionality after a fresh install of i3.&lt;/p&gt;

&lt;p&gt;In addition to that, how should I go about setting things to happen once the lid closes like lock and turn off the screen (and just the screen)?&lt;/p&gt;

&lt;p&gt;I'm running Ubuntu 14.04.&lt;/p&gt;
</title><link>https://faq.i3wm.org/question/5629/how-to-prevent-sleep-on-laptop-lid-close/?comment=5634#comment-5634</link><description>What I meant with "uncomment" was to remove the comment sign (`#`). And then change the value to `lock` or `ignore`, at the moment it is probably `suspend`.</description><pubDate>Thu, 19 Mar 2015 12:25:33 +0000</pubDate><guid>https://faq.i3wm.org/question/5629/how-to-prevent-sleep-on-laptop-lid-close/?comment=5634#comment-5634</guid></item><item><title>Comment by maki57 for &lt;p&gt;Sort of like an antithesis to &lt;a href="https://faq.i3wm.org/question/828/suspend-on-lid-close-for-a-laptop-best-approaches/"&gt;this question&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I'd like to know how to avoid my laptop from sleeping on lid close which seems to be the default functionality after a fresh install of i3.&lt;/p&gt;

&lt;p&gt;In addition to that, how should I go about setting things to happen once the lid closes like lock and turn off the screen (and just the screen)?&lt;/p&gt;

&lt;p&gt;I'm running Ubuntu 14.04.&lt;/p&gt;
</title><link>https://faq.i3wm.org/question/5629/how-to-prevent-sleep-on-laptop-lid-close/?comment=5638#comment-5638</link><description>That worked. Thanks! You can add that as the answer.</description><pubDate>Fri, 20 Mar 2015 01:25:41 +0000</pubDate><guid>https://faq.i3wm.org/question/5629/how-to-prevent-sleep-on-laptop-lid-close/?comment=5638#comment-5638</guid></item><item><title>Comment by maki57 for &lt;p&gt;Sort of like an antithesis to &lt;a href="https://faq.i3wm.org/question/828/suspend-on-lid-close-for-a-laptop-best-approaches/"&gt;this question&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I'd like to know how to avoid my laptop from sleeping on lid close which seems to be the default functionality after a fresh install of i3.&lt;/p&gt;

&lt;p&gt;In addition to that, how should I go about setting things to happen once the lid closes like lock and turn off the screen (and just the screen)?&lt;/p&gt;

&lt;p&gt;I'm running Ubuntu 14.04.&lt;/p&gt;
</title><link>https://faq.i3wm.org/question/5629/how-to-prevent-sleep-on-laptop-lid-close/?comment=5633#comment-5633</link><description>I'm using Ubuntu (I'll edit that in). `HandleLidSwitch` is commented out already in that file.</description><pubDate>Thu, 19 Mar 2015 10:45:59 +0000</pubDate><guid>https://faq.i3wm.org/question/5629/how-to-prevent-sleep-on-laptop-lid-close/?comment=5633#comment-5633</guid></item><item><title>Comment by Adaephon for &lt;p&gt;Sort of like an antithesis to &lt;a href="https://faq.i3wm.org/question/828/suspend-on-lid-close-for-a-laptop-best-approaches/"&gt;this question&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I'd like to know how to avoid my laptop from sleeping on lid close which seems to be the default functionality after a fresh install of i3.&lt;/p&gt;

&lt;p&gt;In addition to that, how should I go about setting things to happen once the lid closes like lock and turn off the screen (and just the screen)?&lt;/p&gt;

&lt;p&gt;I'm running Ubuntu 14.04.&lt;/p&gt;
</title><link>https://faq.i3wm.org/question/5629/how-to-prevent-sleep-on-laptop-lid-close/?comment=5632#comment-5632</link><description>The configuration depends on your OS and distribution. Some Linux distributions use `/etc/systemd/logind.conf` to set the behaviour. There should be a line with `HandleLidSwitch` in there. Uncomment it and set it to `lock`. If this does not do what you want, set it to `ignore` and go from there.</description><pubDate>Thu, 19 Mar 2015 05:57:56 +0000</pubDate><guid>https://faq.i3wm.org/question/5629/how-to-prevent-sleep-on-laptop-lid-close/?comment=5632#comment-5632</guid></item><item><title>Comment by maki57 for &lt;p&gt;Sort of like an antithesis to &lt;a href="https://faq.i3wm.org/question/828/suspend-on-lid-close-for-a-laptop-best-approaches/"&gt;this question&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I'd like to know how to avoid my laptop from sleeping on lid close which seems to be the default functionality after a fresh install of i3.&lt;/p&gt;

&lt;p&gt;In addition to that, how should I go about setting things to happen once the lid closes like lock and turn off the screen (and just the screen)?&lt;/p&gt;

&lt;p&gt;I'm running Ubuntu 14.04.&lt;/p&gt;
</title><link>https://faq.i3wm.org/question/5629/how-to-prevent-sleep-on-laptop-lid-close/?comment=5631#comment-5631</link><description>None of the scripts I found there refer to lid-related events. Mostly just stuff on brightness, power or wireless.</description><pubDate>Thu, 19 Mar 2015 01:02:43 +0000</pubDate><guid>https://faq.i3wm.org/question/5629/how-to-prevent-sleep-on-laptop-lid-close/?comment=5631#comment-5631</guid></item><item><title>Comment by mschaefer for &lt;p&gt;Sort of like an antithesis to &lt;a href="https://faq.i3wm.org/question/828/suspend-on-lid-close-for-a-laptop-best-approaches/"&gt;this question&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I'd like to know how to avoid my laptop from sleeping on lid close which seems to be the default functionality after a fresh install of i3.&lt;/p&gt;

&lt;p&gt;In addition to that, how should I go about setting things to happen once the lid closes like lock and turn off the screen (and just the screen)?&lt;/p&gt;

&lt;p&gt;I'm running Ubuntu 14.04.&lt;/p&gt;
</title><link>https://faq.i3wm.org/question/5629/how-to-prevent-sleep-on-laptop-lid-close/?comment=5630#comment-5630</link><description>you can have a look in you `/etc/apci/` folder. There could be some events and scripts that get triggered depending on certain ACPI-critical buttons</description><pubDate>Wed, 18 Mar 2015 15:07:04 +0000</pubDate><guid>https://faq.i3wm.org/question/5629/how-to-prevent-sleep-on-laptop-lid-close/?comment=5630#comment-5630</guid></item><item><title>Answer by Adaephon for &lt;p&gt;Sort of like an antithesis to &lt;a href="https://faq.i3wm.org/question/828/suspend-on-lid-close-for-a-laptop-best-approaches/"&gt;this question&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I'd like to know how to avoid my laptop from sleeping on lid close which seems to be the default functionality after a fresh install of i3.&lt;/p&gt;

&lt;p&gt;In addition to that, how should I go about setting things to happen once the lid closes like lock and turn off the screen (and just the screen)?&lt;/p&gt;

&lt;p&gt;I'm running Ubuntu 14.04.&lt;/p&gt;
 </title><link>https://faq.i3wm.org/question/5629/how-to-prevent-sleep-on-laptop-lid-close/?answer=5640#post-id-5640</link><description>The configuration depends on your OS and distribution. 

Some Linux distributions use `/etc/systemd/logind.conf` to set the behaviour. 

There should be a line with `HandleLidSwitch` under section `[Login]` in there. On Ubuntu (at least on 14.*) and Arch it is commented out by default, showing the default setting:

    [Login]
    # [...]
    #HandleLidSwitch=suspend
    # [...]

To change the settings you have to uncomment the line and change the value.

According to the `logind.conf(5)` manpage if you set it to `lock`

&gt; [...] all running sessions will be screen locked.

    [Login]
    # [...]
    HandleLidSwitch=lock
    # [...]

This may or may not work with *i3*, it probably again depends on the distribution and display manager.

----

If it does not do what you want, set `HandleLidSwitch` to `ignore`:

    [Login]
    # [...]
    HandleLidSwitch=ignore
    # [...]

This will at least prevent the machine from going to sleep.



</description><pubDate>Fri, 20 Mar 2015 11:08:37 +0000</pubDate><guid>https://faq.i3wm.org/question/5629/how-to-prevent-sleep-on-laptop-lid-close/?answer=5640#post-id-5640</guid></item></channel></rss>