[UNSOLVABLE] Suspend by closing lid

Message
Author
Klaas Vaak
Posts: 144
Joined: Mon Dec 10, 2018 1:50 pm

Re: Suspend by closing lid

#11 Post by Klaas Vaak »

caprea wrote: Mon Mar 04, 2019 9:43 am No, you can edit the file /etc/default/acpi-support
and change it to your needs.
Look at it, it's well documented.
Thanks very much for this tip, caprea.

Klaas Vaak
Posts: 144
Joined: Mon Dec 10, 2018 1:50 pm

Re: Suspend by closing lid

#12 Post by Klaas Vaak »

caprea wrote: Mon Mar 04, 2019 9:43 am

Code: Select all

since suspension by closing the lid cannot be set as such in any of antiX's configurations. Right?
No, you can edit the file /etc/default/acpi-support
and change it to your needs.
Look at it, it's well documented.
In my last reply I said it worked, which is true, but only after the 1st time I uncommented the setting

Code: Select all

LID_SLEEP=true
But after the 2nd time it does not suspend anymore when the lid is closed, even though the setting has not changed.
What could cause that?

caprea
Posts: 146
Joined: Sat Aug 23, 2014 7:01 am

Re: Suspend by closing lid

#13 Post by caprea »

OK,there's another way to try. I once had to do this on a stubborn laptop.Sounds complicated but is easy to do with terminal and rox-filer, if you go step by step.

Create a folder in etc/acpi called actions with

Code: Select all

sudo mkdir -p /etc/acpi/actions
In this folder create a file called lid.sh

In this file (etc/acpi/actions/lid.sh) paste the following script

Code: Select all

#!/bin/bash
echo "$1" | grep -q open /proc/acpi/button/lid/LID0/state && exit 0
sleep 2
/usr/sbin/pm-suspend
Make the script executable with

Code: Select all

sudo chmod +x /etc/acpi/actions/lid.sh
Then change by editing as root the file etc/acpi/events/lidbtn to this

Code: Select all

# /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
Reboot and try.

Klaas Vaak
Posts: 144
Joined: Mon Dec 10, 2018 1:50 pm

Re: Suspend by closing lid

#14 Post by Klaas Vaak »

@Caprea: many thanks for these step-by-step instructions, which is just what I need as a newbie.
Nevertheless, I got stuck:
caprea wrote: Tue Mar 05, 2019 6:24 pm Create a folder in etc/acpi called actions with

Code: Select all

sudo mkdir -p /etc/acpi/actions
Done :smile:
caprea wrote: Tue Mar 05, 2019 6:24 pm In this folder create a file called lid.sh
How do I do that?

I tried to open the folder by doing this:

Code: Select all

sudo geany /etc/acpi/actions
hoping that I could then create a file with Geany.
But when Geany opens I see a number of tabs open, among which the only acpi tab is acpi-support.
So, clearly this is not the right way, hence my question about creating a file.

And the 2nd hurdle:
caprea wrote: Tue Mar 05, 2019 6:24 pm In this file (etc/acpi/actions/lid.sh) paste the following script
Will the file still be open from the previous step?
If not, how do I open the file?

caprea
Posts: 146
Joined: Sat Aug 23, 2014 7:01 am

Re: Suspend by closing lid

#15 Post by caprea »

Like always there are different ways to do that.To avoid to get lost in explanations which possibilities spacefm or rox-filer offer, we stay at the terminal because it is probably the easiest at the moment.

Create the folder actions

Code: Select all

sudo mkdir -p /etc/acpi/actions
You already did that

Create the file lid.sh

Code: Select all

sudo touch /etc/acpi/actions/lid.sh

Open the empty file with leafpad

Code: Select all

sudo leafpad /etc/acpi/actions/lid.sh
In this empty file copy and paste this script

Code: Select all

#!/bin/bash
echo "$1" | grep -q open /proc/acpi/button/lid/LID0/state && exit 0
sleep 2
/usr/sbin/pm-suspend
Close and save

Make the script executable with

Code: Select all

sudo chmod +x /etc/acpi/actions/lid.sh
Now open with leafpad the file etc/acpi/events/lidbtn

Code: Select all

 sudo leafpad /etc/acpi/events/lidbtn
and change the content to this

Code: Select all

# /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
Close and save

Reboot and try, good luck.

Side note: The number of tabs you see when you open geany , are tabs that you have already opened before, if you don't need them anymore you should close them to avoid confusion.

Klaas Vaak
Posts: 144
Joined: Mon Dec 10, 2018 1:50 pm

Re: Suspend by closing lid

#16 Post by Klaas Vaak »

@Caprea: Thanks for your patience and help.
Unfortunately this did not do the trick either. Maybe my computer is such that this simply cannot be implemented.
For example, I managed to get the sound volume fixed (with help on this forum, of course), but when I made the "connection" with the 3 volumes buttons on my keyboard (vol+, vol-, mute), it blocked typing on certain website, and interfered with other things. So I undid the connection and accepted to have to adjust the volume with the volume tray icon.
It seems to me we'll have to leave it at this.

I assume I don't need to undo anything.

caprea
Posts: 146
Joined: Sat Aug 23, 2014 7:01 am

Re: [UNSOLVABLE] Suspend by closing lid

#17 Post by caprea »

Too bad it didn't work out.
Do you have the problem with the volumes buttons on your keyboard also on other linux eg. MX ?
If you like to revert the changes
open with leafpad the file etc/acpi/events/lidbtn

Code: Select all

sudo leafpad /etc/acpi/events/lidbtn
and revert it to the old content

Code: Select all

# /etc/acpi/events/lidbtn
# Called when the user closes or opens the lid

#old
event=button[ /]lid
action=/etc/acpi/lid.sh
This is normally enough, you can also delete the created folder /etc/acpi/actions

Code: Select all

sudo remove /etc/acpi/actions

Klaas Vaak
Posts: 144
Joined: Mon Dec 10, 2018 1:50 pm

Re: [UNSOLVABLE] Suspend by closing lid

#18 Post by Klaas Vaak »

caprea wrote: Thu Mar 07, 2019 2:33 pm Too bad it didn't work out.
Yes, but such is life.
caprea wrote: Thu Mar 07, 2019 2:33 pm Do you have the problem with the volumes buttons on your keyboard also on other linux eg. MX ?
I don't have MX installed; the only other Linux I have installed is Mint, and it is on a Lenovo laptop too and the keyboard volume buttons work fine, I did not even have to make an adjustment in the software.

As for the antiX changes, I assume it is alright to leave them as is because if it would worked I would not have reverted either. Correct?

Post Reply

Return to “antiX”