(Solved: Idle Inhibitor of course!) Prevent suspend after idle in Sway: systemd/logind, swayidle, caffeine-ng etc?

Hi everyone, and thanks for the amazing endeavorOS and sway community edition!
Straight to the point: there are times when I run long commands / programs etc that should run without going to sleep (eg after 10 mins). I’d prefer being able to set this “dynamically” without logging out. What is the “canonical” / best way to prevent this? Here’s what I’ve gleaned on sway so far:

  • /etc/systemd/logind.conf.c/suspend.conf has idleAction=suspend and idleActionSec=10min, so instead of configuring these it’s better to:
  • in .config/sway/config.d/application_defaults we have firefox & Chromium as example app_id windows with inhibit_idle fullscreen;
  • in .config/sway/config.d/autostart_applications we execute swayidle, as far as I understand it’s for the gtklock screen upon waking up from sleep
    Also of interest:
  • some were discussing caffeine-ng on xfce/endeavorOS -related discussions, but I’d assume this is for x, not sway(?)

so, what do you guys use to prevent going to sleep when running long commands? What would you recommend me to do: tweak systemd/logind? swayidle? swayconfig? caffeine-ng or something similar?

I feel so stupid now: there’s “idle inhibitor De/Activated” icon in the swaybar. Well, for anyone looking for this, at least this info’s here! xD

Welcome to the EndeavourOS forum. :handshake: I hope you enjoy your time here.

Glad you have your problem solved. Go to your second post, and click on the small box with a check mark in it. This will notify the forum software (discourse) that the Topic is solved and discourse will do it’s thing.

Pudge

1 Like

Hi Pudge! Cool you’re in the ARMs team! Sure I will. Sorry, never interacted with discourse before. Have a good one!

1 Like

Actually now that I’m at it, I’ll give additional details in case anyone stumbles upon this post: the right name is “waybar”, and the idle inhibitor is an “extension” for waybar, not a totally separate program. As of 2025 Sep, it (and some other stuff) seem to be in the “include/modules” subdirectories in the main waybar git repo. I’m sure the main general discussion of endeavor os sway community edition also has more details on the inclusion of these things into this distro edition.

I will just add, that if I don’t use the idle inhibitor, that swaylock comes on in the middle of a game, so I have used it, and foresee using it a lot when I get home to my desktop computer.

So the inhibitor can have it’s uses :slight_smile:

1 Like

That’s right, the Idle Inhibitor is one of the default Waybar modules you can enable. If you are interested in learning more about different options you can configure in this (or any other) module, check out the Waybar wiki page: https://github.com/Alexays/Waybar/wiki/Module:-Idle-Inhibitor. It gives a chart with all the different options you can add to your Waybar config for customizing the module.

There are actually a ton of modules like this that you can add to your Waybar if you want to, just kind of built in to Waybar (you don’t have to install anything). Check out the list on the side of the wiki page and click on any of the modules you see if you want to check it out.

4 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.