LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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-17-2018, 11:38 PM   #1
enigma9o7
Senior Member
 
Registered: Jul 2018
Location: Silicon Valley
Distribution: Bodhi Linux
Posts: 1,402

Rep: Reputation: 561Reputation: 561Reputation: 561Reputation: 561Reputation: 561Reputation: 561
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, 12:38 AM   #2
the_waiter
Bodhi Developer
 
Registered: Jun 2018
Location: Banská Bystrica, Slovakia
Distribution: Bodhi Linux
Posts: 864

Rep: Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665
Hello

Have you tried Acpi bindings?

https://i.imgur.com/vkLsZOw.jpg
 
1 members found this post helpful.
Old 10-18-2018, 11:13 PM   #3
enigma9o7
Senior Member
 
Registered: Jul 2018
Location: Silicon Valley
Distribution: Bodhi Linux
Posts: 1,402

Original Poster
Rep: Reputation: 561Reputation: 561Reputation: 561Reputation: 561Reputation: 561Reputation: 561
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-18-2018, 11:17 PM   #4
the_waiter
Bodhi Developer
 
Registered: Jun 2018
Location: Banská Bystrica, Slovakia
Distribution: Bodhi Linux
Posts: 864

Rep: Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665
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, 01:36 AM   #5
enigma9o7
Senior Member
 
Registered: Jul 2018
Location: Silicon Valley
Distribution: Bodhi Linux
Posts: 1,402

Original Poster
Rep: Reputation: 561Reputation: 561Reputation: 561Reputation: 561Reputation: 561Reputation: 561
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 01:38 AM.
 
Old 10-19-2018, 04:18 AM   #6
the_waiter
Bodhi Developer
 
Registered: Jun 2018
Location: Banská Bystrica, Slovakia
Distribution: Bodhi Linux
Posts: 864

Rep: Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665
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 04:24 AM.
 
1 members found this post helpful.
Old 10-20-2018, 01:15 AM   #7
enigma9o7
Senior Member
 
Registered: Jul 2018
Location: Silicon Valley
Distribution: Bodhi Linux
Posts: 1,402

Original Poster
Rep: Reputation: 561Reputation: 561Reputation: 561Reputation: 561Reputation: 561Reputation: 561
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, 01: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, 08:02 AM   #9
bobl01
Member
 
Registered: Oct 2018
Location: South West England
Distribution: Bodhi; Manjaro
Posts: 101

Rep: Reputation: 68
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, 11:26 AM   #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, 03:26 PM   #11
bobl01
Member
 
Registered: Oct 2018
Location: South West England
Distribution: Bodhi; Manjaro
Posts: 101

Rep: Reputation: 68
Don't worry about it. We newbies must look out for each other!
 
2 members found this post helpful.
Old 10-23-2018, 06:22 PM   #12
enigma9o7
Senior Member
 
Registered: Jul 2018
Location: Silicon Valley
Distribution: Bodhi Linux
Posts: 1,402

Original Poster
Rep: Reputation: 561Reputation: 561Reputation: 561Reputation: 561Reputation: 561Reputation: 561
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, 02:27 AM   #13
bobl01
Member
 
Registered: Oct 2018
Location: South West England
Distribution: Bodhi; Manjaro
Posts: 101

Rep: Reputation: 68
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 02:28 AM. Reason: Fix typo
 
2 members found this post helpful.
Old 10-24-2018, 10:52 AM   #14
enigma9o7
Senior Member
 
Registered: Jul 2018
Location: Silicon Valley
Distribution: Bodhi Linux
Posts: 1,402

Original Poster
Rep: Reputation: 561Reputation: 561Reputation: 561Reputation: 561Reputation: 561Reputation: 561
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



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 09:32 AM
lock screen before suspend with power button BCarey Slackware 13 11-27-2007 11:04 PM
Somewhat unusual hardware question - power button issues JBroll Linux - Hardware 4 09-30-2006 09:26 PM

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

All times are GMT -5. The time now is 05:06 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
Open Source Consulting | Domain Registration