Don't go asleep if there is something running in a terminal

I would like to keep the computer awake if there is something running in Konsole which is writing to stdout, ansible for example.

Is it possible to do that?

1 Like

I had a similar issue that I resolved by disabling sleep on AC for GDM user:

sudo -u gdm dbus-launch gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type nothing

In your case, it’s worth to check the current power mode with upower before running a long task, or you can use the method @fasulia mentioned below.

What about launching the program with systemd-inhibit?

https://www.freedesktop.org/software/systemd/man/systemd-inhibit.html

If it’s something you do regularly, you could make a systemd service/timer. If you’re concerned about the power mode you could require something like ConditionACPower=true.

4 Likes

Not so good and technical solution as above, but still could be useful in some cases. I use caffeine Gnome extension to manually inhibit power saving / screen turning off when I need to, and I believe i saw similar widget for KDE.

1 Like

I just want to say that the title of this post sounds like a pitch for the worst suspense/horror movie ever. :wink:

2 Likes