The officially official Devuan Forum!

You are not logged in.

#326 Documentation » How to make the 'sleep' button work if yours doesn't » 2017-01-18 18:13:48

sgage
Replies: 2

How to make the 'sleep' button work if yours doesn't

One small issue that I'd been having with Devuan Jessie since I first started using it last October was that the sleep button didn't do anything. The sleep button works fine in Debian Jessie, and I suspect that upower now expects some systemd component or other. BTW, this is an ancient (2008) Compaq Presario, Dual Pentium @ 2 GHz, 4 GB RAM rig. It runs beautifully.

Typing 'sudo pm-suspend' in a terminal worked fine, so I knew that the basic sleep functionality was there. At the suggestion of ralph.ronnquist in the Hardware and System Configuration forum I decided to see if I could come up with an acpi event handler to invoke a script to run pm-suspend.

First I wanted to confirm that the sleep button was indeed generating an acpi event, so I ran acpi_listen and pressed the sleep button. Sure enough, it showed 'button/sleep SBTN 00000080 00000000 K'.

Then I went to /etc/acpi/events to make a handler for this event. There was one there already for the power button (powerbtn-acpi-support), so I just copied and modified it for my sleep button, cleverly named 'sleepbtn-acpi-support', containing the following:

event=button[ /]sleep
action=/etc/acpi/sleepbtn-acpi-support.sh

Then I simply made the sleepbtn-acpi-support.sh script in /etc/acpi, to whit:

#!/bin/sh

# This script calls pm-suspend when the sleep button has been
# pressed.

	# Normal handling.
	/usr/sbin/pm-suspend

That's it. Reboot, or restart the acpi daemon, and voila! A press of the sleep button now sends my computer to sleep! I had the same issue with Devuan Ascii, and the same fix applies.

Of course, now you know how to make the sleep button do whatever you want ;-)

#327 Re: Hardware & System Configuration » Sleep button doesn't work » 2017-01-18 17:07:40

AntoFox wrote:

what version of mate have on you pc?

Standard Devuan Jessie - MATE 1.8.1

The same issue occurs in Ascii (where I am right now) - MATE 1.16.1

#328 Re: Hardware & System Configuration » Sleep button doesn't work » 2017-01-18 17:06:02

golinux wrote:
sgage wrote:

I was able to whip up a simple acpi event catcher and script to have the sleep button work.

Perhaps you could share your fix in Documentation?

sgage wrote:

I did notice, in my poking around, that there is a lot of systemd stuff  in /etc/systemd/system, /lib/systemd, and /var/lib/systemd. What's that all about? Or did it get sucked in by something I installed maybe?

I also have these components installed and found it 'disturbing'.  That question has been asked before  - maybe by me -  but I can't remember the answer. LOL! I'll throw it up on #devuan and see who bites . . .

I will write it up soon and post in Documentation. If nothing else, you can have endless fun making the 'special buttons' do whatever you want...

Yes, I'd be interested in learning something about all that systemd junk...

#329 Re: Hardware & System Configuration » Sleep button doesn't work » 2017-01-18 15:15:51

I was able to whip up a simple acpi event catcher and script to have the sleep button work.

I did notice, in my poking around, that there is a lot of systemd stuff  in /etc/systemd/system, /lib/systemd, and /var/lib/systemd. What's that all about? Or did it get sucked in by something I installed maybe?

#330 Re: Hardware & System Configuration » Sleep button doesn't work » 2017-01-18 14:02:04

ralph.ronnquist wrote:

If the button results in an ACPI event, you could deal with it through that: a "rules file" in /etc/acpi/events to recognize it and map to a script, and that script invoking pm-suspend, habitually placed in /etc/acpi.

I'll see if I can cobble something together.

BTW, many thanks everyone for the input/suggestions!

#331 Re: Hardware & System Configuration » Sleep button doesn't work » 2017-01-18 14:00:02

golinux wrote:

Do you have upower installed?  That used to be the solution but may not be going forward.  There is history in the botbot logs.

Yes, I have upower installed. It seems that the latest version of upower dropped support for some hardware - it let's systemd handle it.

#332 Re: Hardware & System Configuration » Sleep button doesn't work » 2017-01-18 03:02:40

golinux wrote:

Does suspend work from the logout menu?

I don't see a suspend option. I am running MATE. If I select log out, it just logs me out to the greeter screen to log back in again.

#333 Hardware & System Configuration » Sleep button doesn't work » 2017-01-17 22:55:05

sgage
Replies: 14

Pressing the 'sleep' button on the keyboard of my Compaq Presario desktop doesn't do anything. 'pm-suspend' works fine - the machine sleeps and wakes properly.

The sleep button does work properly in Debian Jessie.

#334 Re: Forum Feedback » Congratulations on a good move! » 2017-01-14 22:09:13

fanderal, I agree with you 100%. What happened with Debian was very sad, and very troubling. The Windows-ification of Linux distros is proceeding apace, and we are indeed fortunate to have the Devuan project and folks...

Board footer

Forum Software