<?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/6665/" rel="self"></atom:link><language>en</language><copyright>Copyright i3, 2012</copyright><lastBuildDate>Thu, 24 Sep 2015 11:28:38 +0000</lastBuildDate><item><title>lockscreen after closing my laptop</title><link>https://faq.i3wm.org/question/6665/lockscreen-after-closing-my-laptop/</link><description>Hi Guys

This is my second Day with i3 and most thigs are pretty straight forward, but some things i just don't know how to deal with.
My biggest problem along some others is that i'm not able to get a lock screen after opening my laptop again and this is essential for me. I just want to be promted for my password like i3lock does it. But why isn't it executed by my laptop going in sleep mode.?

Bye </description><pubDate>Tue, 22 Sep 2015 22:29:29 +0000</pubDate><guid>https://faq.i3wm.org/question/6665/lockscreen-after-closing-my-laptop/</guid></item><item><title>Answer by ManusX for &lt;p&gt;Hi Guys&lt;/p&gt;

&lt;p&gt;This is my second Day with i3 and most thigs are pretty straight forward, but some things i just don't know how to deal with.
My biggest problem along some others is that i'm not able to get a lock screen after opening my laptop again and this is essential for me. I just want to be promted for my password like i3lock does it. But why isn't it executed by my laptop going in sleep mode.?&lt;/p&gt;

&lt;p&gt;Bye &lt;/p&gt;
 </title><link>https://faq.i3wm.org/question/6665/lockscreen-after-closing-my-laptop/?answer=6674#post-id-6674</link><description> Create a file ` /etc/systemd/system/sleep.target.wants/screenlock.service` which contains:

    [Unit]
    Description=Starts i3lock at suspend time
    Before=sleep.target
    
    [Service]
    User=&lt;YOURUSERNAME&gt;
    Type=forking
    Environment=DISPLAY=:0
    ExecStartPre=
    ExecStart=/usr/local/bin/lockandblur.sh
    
    [Install]
    WantedBy=sleep.target


`/usr/local/bin/lockandblur.sh` should be exchanged by whatever you want to do, a simple `i3lock` would also succeed (in my case this is a script which takes a screenshot, blurs it using image magick and then uses it as lockscreen).
</description><pubDate>Thu, 24 Sep 2015 11:28:38 +0000</pubDate><guid>https://faq.i3wm.org/question/6665/lockscreen-after-closing-my-laptop/?answer=6674#post-id-6674</guid></item><item><title>Answer by SpicyCat for &lt;p&gt;Hi Guys&lt;/p&gt;

&lt;p&gt;This is my second Day with i3 and most thigs are pretty straight forward, but some things i just don't know how to deal with.
My biggest problem along some others is that i'm not able to get a lock screen after opening my laptop again and this is essential for me. I just want to be promted for my password like i3lock does it. But why isn't it executed by my laptop going in sleep mode.?&lt;/p&gt;

&lt;p&gt;Bye &lt;/p&gt;
 </title><link>https://faq.i3wm.org/question/6665/lockscreen-after-closing-my-laptop/?answer=6668#post-id-6668</link><description>If you want to lock your screen after some time, you can use `xautolock`

    exec --no-startup-id xautolock -time 4 -locker "i3lock-wrapper -l"

And I create a mode to handle lock, suspend, hibernate, reboot and poweroff

    set $Locker i3lock-wrapper -l &amp;&amp; sleep 1

    set $mode_system System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown
    mode "$mode_system" {
        bindsym l exec --no-startup-id $Locker, mode "default"
        bindsym e exec --no-startup-id i3-msg exit, mode "default"
        bindsym s exec --no-startup-id $Locker &amp;&amp; systemctl suspend, mode "default"
        bindsym h exec --no-startup-id $Locker &amp;&amp; systemctl hibernate, mode "default"
        bindsym r exec --no-startup-id systemctl reboot, mode "default"
        bindsym Shift+s exec --no-startup-id  systemctl poweroff -i, mode "default"

        # back to normal: Enter or Escape
        bindsym Return mode "default"
        bindsym Escape mode "default"
    }

    bindsym $mod+Delete mode "$mode_system"

If you mean lock and suspend when closing laptop lid, you can check [this repo](https://github.com/ruudud/i3wm-scripts) and [this post](https://faq.i3wm.org/question/828/suspend-on-lid-close-for-a-laptop-best-approaches/)</description><pubDate>Wed, 23 Sep 2015 03:19:16 +0000</pubDate><guid>https://faq.i3wm.org/question/6665/lockscreen-after-closing-my-laptop/?answer=6668#post-id-6668</guid></item><item><title>Answer by dd0 for &lt;p&gt;Hi Guys&lt;/p&gt;

&lt;p&gt;This is my second Day with i3 and most thigs are pretty straight forward, but some things i just don't know how to deal with.
My biggest problem along some others is that i'm not able to get a lock screen after opening my laptop again and this is essential for me. I just want to be promted for my password like i3lock does it. But why isn't it executed by my laptop going in sleep mode.?&lt;/p&gt;

&lt;p&gt;Bye &lt;/p&gt;
 </title><link>https://faq.i3wm.org/question/6665/lockscreen-after-closing-my-laptop/?answer=6667#post-id-6667</link><description>I use these to lock, not sure if it's a good method.
&lt;pre&gt;
# lock screen
bindsym $mod+Delete exec --no-startup-id "i3lock -c 000000"
# lock screen and suspend
bindsym $mod+End exec --no-startup-id "i3lock -c 000000 &amp;&amp; systemctl suspend"
# lock and hibernate
bindsym $mod+Insert exec --no-startup-id "i3lock -c 000000 &amp;&amp; systemctl hibernate"
&lt;/pre&gt;</description><pubDate>Wed, 23 Sep 2015 00:41:46 +0000</pubDate><guid>https://faq.i3wm.org/question/6665/lockscreen-after-closing-my-laptop/?answer=6667#post-id-6667</guid></item></channel></rss>