Suspend on closing lid?

  • This topic has 5 replies, 3 voices, and was last updated May 20-5:17 am by wean_irdeh.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #10342
    Member
    wean_irdeh

      Right now after closing the lid, the laptop will be locked on opening the lid.
      Is it possible to make the laptop suspend instead of lock it?
      If possible also please post the command for suspend and lock the laptop
      Thanks

      #10343
      Member
      wean_irdeh
        Helpful
        Up
        0
        ::

        Ah I’ve found the command to suspend and lock the screen.
        To suspend the laptop: pm-suspend
        To lock the screen: xlock
        But the question remain on how to suspend the laptop after closing the lid..

        #10359
        Moderator
        caprea
          Helpful
          Up
          0
          ::

          This is what i did to make my laptop shutdown, when closing the lid.

          Created a folder in etc/acpi called actions

          mkdir -p /etc/acpi/actions

          in this folder created a file called lid.sh

          etc/acpi/actions/lid.sh

          with the following script

          #!/bin/bash
          echo "$1" | grep -q open /proc/acpi/button/lid/LID0/state && exit 0
          sleep 2
          /sbin/poweroff -f

          Made the script executable

          chmod +x /etc/acpi/actions/lid.sh

          Then I changed the file etc/acpi/events/lidbtn to this

          # /etc/acpi/events/lidbtn
          # Called when the user closes or opens the lid
          
          #old
          #event=button[ /]lid
          #action=/etc/acpi/lid.sh
          
          #new
          event=button/lid
          action=/etc/acpi/actions/lid.sh %e

          Rebooted.

          To make your laptop suspend when closing the lid you have to change the last line from the script etc/acpi/actions/lid.sh

          from /sbin/poweroff -f
          to

          /usr/sbin/pm-suspend

          BUT I’m not sure, if this is the most expedient and easiest way to do this on antiX.
          Maybe you wait for another suggestion, anyway for me it works.

          #10363
          Member
          isminaki
            Helpful
            Up
            0
            ::

            I had the same question and found this:

            https://antixlinux.com/forum-archive/laptop-suspend-solved-t5071.html

            It works for me.

            #10365
            Moderator
            caprea
              Helpful
              Up
              0
              ::

              Oh well, this is indeed more straightforward !

              #10373
              Member
              wean_irdeh
                Helpful
                Up
                0
                ::

                I had the same question and found this:

                https://antixlinux.com/forum-archive/laptop-suspend-solved-t5071.html

                It works for me.

                Ah thanks, editing /etc/default/acpi-support and removing hash (#) from #LID_SLEEP=true works for me! I can even disable lock screen by adding hash (#) in LOCK_SCREEN=true
                Thanks a lot

                And thanks to caprea for trying to help me

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