A person, on the Gnome Issue, suggested that terminals inhibit sleep when there is stuff running in them.

Continuing from that discussion, I am trying to understand, at which point it would be desirable to implement said inhibition - terminal emulator, the shell or the program itself

Additionally:

  • We want to inhibit when running stuff like pacman, wget, cp or mv
  • We don’t want to inhibit when running stuff like htop, less, watch
  • ulternoOP
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    10 hours ago

    There is already a separate systemd-inhibit command that does exactly what you need. Trust your users, they are capable of googling it (most of the time).

    Thanks for this. I now have an idea that would work at least for my case.

    So, in case the user runs some long-running command and doesn’t remember to use systemd-inhibit, but then decides they should have done so (which seems like something that would happen to me a lot), there can be an option in the console to inhibit until the end of said process.

    Still, automates nothing though, so maybe that’s just upto aliases and stuff.


    to scan your system for active TCP connections

    I was thinking in similar lines. Just need to decide what cases are worth keeping on for.
    e.g.

    • You may not want to inhibit sleep just for an idle ssh in a terminal.
    • You may want to inhibit in case you are encoding a video using ffmpeg. (in case of GUI programs, they are pretty full of stuff and I would expect them to inhibit when encoding)