LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Bodhi
User Name
Password
Bodhi This forum is for the discussion of Bodhi Linux.

Notices


Reply
  Search this Thread
Old 10-18-2018, 12:38 AM   #1
enigma9o7
Member
 
Registered: Jul 2018
Location: Silicon Valley
Distribution: Bodhi 5 (Ubuntu 18.04)
Posts: 156

Rep: Reputation: Disabled
How to set hardware power button to suspend?


I've tried using key bindings for XF86PowerOff or XF86PowerDown but neither seems to change anything.

Ubuntu directions don't seem to apply as they apperantly have the hardware power button set to bring up a dialog, and people use a gui to change it that bodhi doesn't offer to my knowledge.

Any ideas?
 
Old 10-18-2018, 01:38 AM   #2
the_waiter
Bodhi Developer
 
Registered: Jun 2018
Location: Banská Bystrica, Slovakia
Distribution: Bodhi Linux
Posts: 155

Rep: Reputation: 88
Hello

Have you tried Acpi bindings?

https://i.imgur.com/vkLsZOw.jpg
 
1 members found this post helpful.
Old 10-19-2018, 12:13 AM   #3
enigma9o7
Member
 
Registered: Jul 2018
Location: Silicon Valley
Distribution: Bodhi 5 (Ubuntu 18.04)
Posts: 156

Original Poster
Rep: Reputation: Disabled
You had me hopeful for a second there, and I was kicking myself for forgetting about that as I'd found it when I was trying to get backlight control to work on my laptop (that I still never solved).

However, same thing. Still shutdown.
 
Old 10-19-2018, 12:17 AM   #4
the_waiter
Bodhi Developer
 
Registered: Jun 2018
Location: Banská Bystrica, Slovakia
Distribution: Bodhi Linux
Posts: 155

Rep: Reputation: 88
How to set hardware power button to suspend?

I will try this today on my laptop. Let me have some time...
 
1 members found this post helpful.
Old 10-19-2018, 02:36 AM   #5
enigma9o7
Member
 
Registered: Jul 2018
Location: Silicon Valley
Distribution: Bodhi 5 (Ubuntu 18.04)
Posts: 156

Original Poster
Rep: Reputation: Disabled
Ok. And thanks. Obviously it's not actually important or causing any problems, but I bet its doable somehow. I'm actually trying to get this to work on my two older desktop computers, not my laptop, incase that matters. They're always plugged in so would be nice if we didn't have to wait to boot, and my kids normally turn them on/off with the power button. We end up leaving them on more often that we should to avoid booting incase we think we'll use it later, etc, basically end up on most of the time even tho only used an hour or two a day.

Last edited by enigma9o7; 10-19-2018 at 02:38 AM.
 
Old 10-19-2018, 05:18 AM   #6
the_waiter
Bodhi Developer
 
Registered: Jun 2018
Location: Banská Bystrica, Slovakia
Distribution: Bodhi Linux
Posts: 155

Rep: Reputation: 88
Hmm, what do you think about going to suspend automatically after some idle time? There is a setting in Moksha to do this. If your kids are away from PC more than max. 90 min, PC will blank and you can setup it for also suspend when blank. Just an idea

https://i.imgur.com/JL722Vx.jpg

Last edited by the_waiter; 10-19-2018 at 05:24 AM.
 
1 members found this post helpful.
Old 10-20-2018, 02:15 AM   #7
enigma9o7
Member
 
Registered: Jul 2018
Location: Silicon Valley
Distribution: Bodhi 5 (Ubuntu 18.04)
Posts: 156

Original Poster
Rep: Reputation: Disabled
I already thought about suspend on blank weeks ago, but it had a max delay of like 20 seconds. If I could use something like 5 minutes (after blank), I'd be using that already.
 
Old 10-20-2018, 02:02 PM   #8
wjwieland
LQ Newbie
 
Registered: Oct 2018
Location: MN and WI
Distribution: Bodhi 5.X
Posts: 13

Rep: Reputation: Disabled
Smile Give this a shot...

A friend of mine was looking for a way to change lid-close behavior on a laptop running Ubuntu. I found the following info in the link below solved that problem and noticed that there is a power-button setting in the file as well. I have not tried this, but it may give you what you want....

Look at the #HandlePowerKey=poweroff setting in /etc/systemd/logind.conf. I believe that setting can be changed to suspend....

This link explains the capability of logind.conf pretty clearly, and I think this might provide you with what you are looking for.....

https://www.freedesktop.org/software...gind.conf.html


Another discussion regarding this subject:
https://superuser.com/questions/6999...x-power-button

Hope that is helpful....
 
Old 10-23-2018, 09:02 AM   #9
bobl01
Member
 
Registered: Oct 2018
Posts: 54

Rep: Reputation: Disabled
Quote:
Originally Posted by wjwieland View Post
Look at the #HandlePowerKey=poweroff setting in /etc/systemd/logind.conf. I believe that setting can be changed to suspend....
Hope that is helpful....
I had a similar issue which I solved by a similar fix. However, you must remove the # sign at the start of the line, and I changed the value to ignore. Once I'd confirmed that the power button was ignored ok, I reprogrammed the power off key in Key Bindings to System Controls, giving the user a choice of options after the button was pressed.
 
Old 10-23-2018, 12:26 PM   #10
wjwieland
LQ Newbie
 
Registered: Oct 2018
Location: MN and WI
Distribution: Bodhi 5.X
Posts: 13

Rep: Reputation: Disabled
My mistake...

bobl01,

You are right of course! The '#' has to be removed.

I was too sloppy on the copy paste it would seem...
Thanks
 
1 members found this post helpful.
Old 10-23-2018, 04:26 PM   #11
bobl01
Member
 
Registered: Oct 2018
Posts: 54

Rep: Reputation: Disabled
Don't worry about it. We newbies must look out for each other!
 
2 members found this post helpful.
Old 10-23-2018, 07:22 PM   #12
enigma9o7
Member
 
Registered: Jul 2018
Location: Silicon Valley
Distribution: Bodhi 5 (Ubuntu 18.04)
Posts: 156

Original Poster
Rep: Reputation: Disabled
Thanks so much! I'm on the right track.

Trying ignore made power button bring up a dialog do you want to suspend, and didn't do anything until hit yes or no. (I had already tried the key bindings and acpi bindings).

Trying suspend works! Power button suspends. But, it still brings up that dialog, it just suspends anyway; however it's there when I resume...
 
1 members found this post helpful.
Old 10-24-2018, 03:27 AM   #13
bobl01
Member
 
Registered: Oct 2018
Posts: 54

Rep: Reputation: Disabled
You may have to play around with the settings.

I found that I had to set HandlePowerKey to ignore, and then remove all references to power key (I think there were two entries) from Key Bindings, and another power key reference from ACPI Bindings (on the same page as Key Bindings). Once I'd done this, the system really did ignore the power key and it did nothing at all when pressed.

Then, I went back into Key Bindings, clicked the button to add a new binding, and I pressed the power key. That created new entry which was (IIRC) XF86PowerDown. I was then able to associate this with System Tools, and I got the behaviour I desired.

One word or caution with ACPI bindings. If you set HandlePowerKey to ignore, then be really careful if you click the Add button to add a new event in ACPI Bindings. It caused the system to hang and I couldn't get out of it. I had to yank the power cord to forcibly crash out!! Learn from my mistake!!!

I believe all this really depends on your particular hardware, and the correct settings will vary from computer to computer, so your solution may be different.

Last edited by bobl01; 10-24-2018 at 03:28 AM. Reason: Fix typo
 
2 members found this post helpful.
Old 10-24-2018, 11:52 AM   #14
enigma9o7
Member
 
Registered: Jul 2018
Location: Silicon Valley
Distribution: Bodhi 5 (Ubuntu 18.04)
Posts: 156

Original Poster
Rep: Reputation: Disabled
I'll play around with it.

Something I find odd, the computer is back on this morning. I suspended it that way yesterday sometime and haven't touched the computer since, but just noticed the screen is on. I also have it set to suspend on blank so besides waking up by itself, it should suspend itself anyway.

And when I tried to suspend on another computer (even from the menu) it just hung on suspending.

And, on my laptop, which I don't ever want to suspend as it's a server, I was pretty sure I had set it to do nothing when screen closes, but it suspended when I closed my screen.

So I guess I have some work ahead of me if I want the suspension behaviour I want.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How would laptop power button affect hardware scan during Linux bootup? redss Ubuntu 1 02-28-2012 10:32 AM
lock screen before suspend with power button BCarey Slackware 13 11-28-2007 12:04 AM
Somewhat unusual hardware question - power button issues JBroll Linux - Hardware 4 09-30-2006 10:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Bodhi

All times are GMT -5. The time now is 03:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration