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?

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.


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:


I found another way to do this:

  • Right click on the System Tray and select ‘Configure System Tray’
  • Under ‘Extra Items’ check the ‘Display Configuration’ item
  • Click ‘Apply’

A new item appears on the system tray which looks like a monitor, if you click on it there is a check box for:
‘Enable Presentation Mode’.