Auto Suspend

  • This topic has 13 replies, 6 voices, and was last updated Oct 2-1:18 am by sfink16.
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #89370
    Member
    sfink16

      Hi everyone,

      I just installed AntiX, on a very low end Acer 32-bit laptop, and enjoy it very much. One thing that I couldn’t find was a timeout to suspend the session to save on power. I did use the screen-blank feature. I have that feature on my Ubuntu 22.04 desktop. I know that I can manually hit the Suspend button, but my wife will be the primary user, and she is not technically inclined. I am using the default full install, 32-bit AntiX desktop (I forget which one it is). I updated to the latest kernel 5.10. Am I missing something?

      Steve

      • This topic was modified 7 months, 2 weeks ago by sfink16.
      #89379
      Moderator
      BobC
        Helpful
        Up
        0
        ::

        Not sure if you can afford the memory or how much CPU it uses, but it sounds like XFCE Power Manager (package name: xfce4-power-manager) has all of the features you are looking for.

        Without a lot of effort, I doubt Hibernate will work, BTW.

        Maybe someone has a lighter solution?

        #89389
        Member
        sybok
          Helpful
          Up
          0
          ::

          I have no custom solution, only a general idea.
          The necessary thing to do is to track input to HID (Human Interface Devices), i.e. some sort of key/mouse/touch-logger.
          If the last input is older than the threshold, suspend the PC.
          Using any additional library that needs to be installed may raise concerns about privacy.

          One could do the following based on the status of monitor.
          This below assumes that monitor gets suspended after a period of inactivity.
          0) Script, the “core” code runs in a while loop, e.g. every minute.
          1) Monitor if any monitor is connected (e.g. via ‘xset -q’: ‘Monitor is On’ or using ‘xrandr’) and whether it is suspended (???).
          2) If several [configurable]c consequtive iterations (e..g how many minutes) (in the loop) detect monitor is suspended or off/disconnected, suspend the PC.

          Caveats:
          My home PC with antiX testing – in order to wake up the monitor, I have to press a key, mouse does not work.

          #89390
          Member
          manyroads
            Helpful
            Up
            0
            ::

            Have you tried?

            According to the Ubuntu Forum you can use the following commands:
            
            pmi action suspend
            
            and
            
            pmi action hibernate
            
            This requires that you install the powermanagement-interface package (not tested).
            
            sudo apt-get install powermanagement-interface

            If one works, just create a keybinding for your favorite.

            Pax vobiscum,
            Mark Rabideau - http://many-roads.com
            "For every complex problem there is an answer that is clear, simple, and wrong." H. L. Mencken
            dwm & i3wm ~Reg. Linux User #449130
            20 Jan 2021 ~ "End of an Error"

            #89427
            Member
            sfink16
              Helpful
              Up
              0
              ::

              Thanks everyone for the responses! I haven’t had a chance to try any out yet but will let you know if any work.

              #89503
              Member
              sfink16
                Helpful
                Up
                0
                ::

                Not sure if you can afford the memory or how much CPU it uses, but it sounds like XFCE Power Manager (package name: xfce4-power-manager) has all of the features you are looking for.

                Without a lot of effort, I doubt Hibernate will work, BTW.

                Maybe someone has a lighter solution?

                I tried to use the xfce power management feature and found that the suspend button was grayed out. I’m giving up for now after that test.

                #89556
                Moderator
                Brian Masinick
                  Helpful
                  Up
                  0
                  ::

                  I don’t know how you have your system set up, but based on past situations when I’ve set up either Suspend, Hibernate, or both, they do come with some prerequisites:

                  1) Swap partition, typically enough for AT LEAST the amount of RAM (memory) in your system; the old recommendation used to be TWICE the amount of system memory; that can be a LOT of space that’s seldom actually used EXCEPT when Suspend or Hibernate functions are actually used.

                  2) Enough disk space to allocate a swap space greater than the size of your system memory!

                  If you meet these requirements, try setting up your system accordingly and see if it makes any difference.

                  CAVEAT: these USED to be the requirements; I’ve used Suspend and Hibernate in the past, but I’ve not done so recently, so I can not guarantee from RECENT personal experience that these are the correct or only current requirements; check my information out to see if it is still accurate information!

                  --
                  Brian Masinick

                  #89599
                  Member
                  sfink16
                    Helpful
                    Up
                    0
                    ::

                    Brian,

                    I’m not sure I’m following. I don’t think swap partition space would matter when trying to get AntiX to automatically Suspend/Hibernate after a specified period of time. I have no issues with clicking Leave, than Suspend button to Suspend the laptop. What am I missing?

                    Steve

                    #89601
                    Moderator
                    Brian Masinick
                      Helpful
                      Up
                      0
                      ::

                      If you are sure my suggestion is irrelevant feel free to ignore it; that’s what I have done in the past and it did work for me to enable suspend and hibernate.

                      Try another solution, it’s OK with me.

                      --
                      Brian Masinick

                      #89602
                      Member
                      marcelocripe
                        #89617
                        Member
                        sfink16
                          Helpful
                          Up
                          0
                          ::

                          If you are sure my suggestion is irrelevant feel free to ignore it; that’s what I have done in the past and it did work for me to enable suspend and hibernate.

                          Try another solution, it’s OK with me.

                          Brian,

                          I wasn’t suggesting it was irrelevant, rather looking for clarification. The Swap partition is already the same size as the memory. That doesn’t seem to work. So the other solution is that I taught my wife how to Suspend the session and wake it up again after.

                          Steve

                          #89620
                          Moderator
                          Brian Masinick
                            Helpful
                            Up
                            0
                            ::

                            Swap size the same size as memory is insufficient; make it larger; twice the memory size if possible; that works.

                            If manually suspending the system works and that’s enough then don’t change anything.

                            --
                            Brian Masinick

                            #89638
                            Moderator
                            BobC
                              Helpful
                              Up
                              0
                              ::

                              Yes, XFCE Power Manager doesn’t seem to work anymore.

                              I found this site with a script that might work:
                              https://www.linuxquestions.org/questions/linux-newbie-8/how-to-suspend-after-idle-or-inactivity-period-without-desktop-environment-or-x-4175524123/

                              #90034
                              Member
                              sfink16
                                Helpful
                                Up
                                0
                                ::

                                I have revisited this using a suggestion from another source (FB group) and thought I’d share. Adding the LXQT Power management tool gives a few more options that I didn’t have before. Under this power management tool I can use the “Close Lid” option to automatically Suspend the laptop. The “Idle” option doesn’t seem to work. IMO, it’s slightly better than have to click the Menu/Leave/Suspend sequence.

                                Thanks for all the suggestions!

                                Steve

                              Viewing 14 posts - 1 through 14 (of 14 total)
                              • You must be logged in to reply to this topic.