[SOLVED]What is the best way to have auto-suspend into antiX ?

Forum Forums General Tips and Tricks [SOLVED]What is the best way to have auto-suspend into antiX ?

  • This topic has 7 replies, 3 voices, and was last updated May 10-2:18 am by oops.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #21202
    Member
    oops

      What is the best way to have auto-suspend into antiX ?

      dolphin_oracle wrote:
      I think what you need is in /etc/default/acpi-support. Look for this line

      Code: Select all
      # Uncomment this to enable ACPI sleep when the lid screen is closed.
      #LID_SLEEP=true

      and try uncommenting the LID_SLEEP line.

      I have seen this tip & trick, and that’s work for the lid screen.

      But I also would like to have an auto-suspend mode at, for example, after 15 minutes inactivity, and I do not seen any available options for “power management” into the “Control Center”, and ether.

      So what is the best practice for antiX ?
      Maybe :linrunner , or an other sofware like that ?
      https://linrunner.de/en/tlp/tlp.html

      • This topic was modified 3 years, 12 months ago by oops.
      #21208
      Moderator
      caprea
        Helpful
        Up
        0
        ::

        If you’re just looking to auto-suspend after 15 minutes, you could try xautolock.

        Install xautolock. Then add this to your startup-file in the hidden ./desktop-session folder in home

        #suspend after 15 min
         xautolock -time 15 -locker "sudo pm-suspend" &
        #21224
        Member
        oops
          Helpful
          Up
          0
          ::

          Thank you Caprea, perfect;
          I have just to adapt this for a normal user (no root/sudo)

          • This reply was modified 4 years ago by oops.
          #21236
          Anonymous
            Helpful
            Up
            0
            ::

            to grant permission for a normal user, you can
            sudo visudo
            or add a rule within /etc/sudoers.d/antixers
            %users ALL=(root) NOPASSWD: /usr/bin/xautolock
            (untested: may also need to grant /usr/sbin/pm-suspend )

            #21240
            Member
            oops
              Helpful
              Up
              0
              ::

              Thank you Skidoo, your are faster than me 😉 … I choose another way (your should work too):

              Yes I have created a new file into /etc/sudoers.d/users-custom_pm-suspend
              … and added:

              # sudoers file.
              #%users ALL=(root) NOPASSWD: /usr/sbin/pm-suspend
              #.. to add ...:
              
              #leafpad /etc/sudoers.d/users-custom_pm-suspend
              # then ...
              #chmod 440 /etc/sudoers.d/users-custom_pm-suspend
              
              user1-antix ALL=(root) NOPASSWD: /usr/sbin/pm-suspend
              user2-antix ALL=(root) NOPASSWD: /usr/sbin/pm-suspend
              user3-antix ALL=(root) NOPASSWD: /usr/sbin/pm-suspend
              
              #... or for all user#
              #user5-antix ALL=(root) NOPASSWD: /usr/sbin/pm-suspend
              
              #ou 
              #%users ALL=(ALL) NOPASSWD: /usr/sbin/pm-suspend

              … Then add for this user1 , to file:
              /home/users1-antix/.desktop-session/startup

              #suspend after 15 min
               xautolock -time 15 -locker "sudo pm-suspend" &
              • This reply was modified 4 years ago by oops.
              #21243
              Moderator
              caprea
                Helpful
                Up
                0
                ::

                Maybe I’m wrong, but I think because /usr/sbin/pm-suspend is already part of the /etc/sudoers.d/antixers-file,
                the above step is not necessary, and it should work without.

                #21253
                Member
                oops
                  Helpful
                  Up
                  0
                  ::

                  … Needed above steps here if the user is not root nor sudo.

                  $ inxi -Sxxxx
                  System:    Host: antix1 Kernel: 5.0.0 i686 bits: 32 compiler: gcc v: 6.3.0 Desktop: IceWM 1.4.2 
                             info: icewmtray dm: SLiM 1.3.4 Distro: antiX-17.4.1_386-full Helen Keller 28 March 2019 
                             base: Debian GNU/Linux 9 (stretch) 
                  #21364
                  Member
                  oops
                    Helpful
                    Up
                    0
                    ::

                    `#suspend after 15 min
                    xautolock -time 15 -locker “sudo pm-suspend” &`

                    # into my ~/.desktop-session/startup
                    # to get a locked screen after waking up your computer from suspend to RAM ... I finally also used i3lock:
                    xautolock -time 15 -locker "i3lock -c 000000 && echo 'mem > /sys/power/state' && sudo pm-suspend" &
                    • This reply was modified 3 years, 12 months ago by oops.
                  Viewing 8 posts - 1 through 8 (of 8 total)
                  • You must be logged in to reply to this topic.