1

I recently got into the i3 ecosystem and am starting to configure it. I noticed that the system does not auto lock and suspend like Gnome would do after certain amount of idle time. What would be your way to configure Arch Linux with i3 running to auto lock and suspend after certain period of idling?

2 Answers 2

1

To control power-related stuff (like suspend, laptop lid closing, etc) you need to start some power management tool, e.g. you could use mate-power-manager from MATE. Add it to your i3 config file and configure using Power Management application:

# ~/.config/i3/config
exec --no-startup-id mate-power-manager 

For screen lock you could use xautolock and i3lock-fancy. Add it to i3 config:

# ~/.config/i3/config
exec xautolock -time 30 -locker '&& i3lock-fancy -p' -notify 30 -notifier "notify-send -u critical -t 10000 -- 'LOCKING screen in 30 seconds'"

Above command will lock you screen after 30 minutes of inactivity with blurred screenshot of you current screen (also showing you warning 30 seconds before that).

4
  • So going into your answer, I do have some questions, I installed the mate-power-manager, bu there is no Power Management app. Is that a separate installation?
    – Asmodean
    Jan 15, 2021 at 16:32
  • So apparently you had to go into mate-power-preferences
    – Asmodean
    Jan 15, 2021 at 18:51
  • @Asmodean , yes, the command itself is mate-power-preferences, "Power Management" is its XDG name.
    – anlar
    Jan 15, 2021 at 19:52
  • Would you mind looking at this? It seemed like I can't get it to work: unix.stackexchange.com/questions/629579/…
    – Asmodean
    Jan 17, 2021 at 17:23
0

So thanks to anlar we have a solution to the problem, the tool mate-power-manager can suspend the system automatically, and xautolock, which triggers a locking mechanism actually locks your computer. My take on this was to just use the i3lock, as its simple functions were more than enough for me. But if you do want the fancier appearance, do use the i3lock-fancy

In any case, below are references to this subject and other alternatives:

https://wiki.archlinux.org/index.php/Power_management https://github.com/meskarune/i3lock-fancy

Thanks for reading, hope this will help others out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.