• Lucy :3@feddit.org
    link
    fedilink
    arrow-up
    32
    ·
    1 day ago

    Though you still have to suspend by yourself when you’re done.

    Does

    ExecPost=systemctl suspend
    

    work ?

    • Björn TantauOPA
      link
      fedilink
      arrow-up
      34
      ·
      1 day ago

      Probably.

      But what if the timer triggered during normal operation? Then your computer would suddenly suspend on its own and you wouldn’t know why.

      I’ve already made a feature request to only run when the system is suspended.

      Until then I’ll look at when the system woke up and if that was less than a minute ago turn off the display and suspend after everything is done.

    • nesc@lemmy.cafe
      link
      fedilink
      English
      arrow-up
      8
      ·
      1 day ago

      Can’t you just suspend with another timer that calls Unit=suspend.target?

      • Björn TantauOPA
        link
        fedilink
        arrow-up
        4
        ·
        13 hours ago

        Yes, do that a minute after everything else started but run the services themselves with systemd-inhibit (another nice thing I didn’t know exists) so that it only goes back to sleep when the last service is done.