Shutdown when Powerbutton is pressed

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read this

Shutdown when Powerbutton is pressed

Postby Zyzz on Wed Aug 01, 2012 5:57 pm

Hi,

I want to have my PC shutdown when I push/press the power button. Atm it suspends to ram (I guess, as the led is still blinking) which is pretty annoying. Does LMDE think I'm on a notebook? If so why does it think and not work. ;)

I use LMDE with Cinnamon as DE and I can't find an option anywhere to change the behavior of the power button.

I already searched the web and this forum but couldn't find a correct answer (or I'm to stupid to search if so pls forward me to a topic :))

I also tried gnome-power-manager but it says it's not installed. Looking in synaptics I see it's installed but the bin is called gnome-power-statistics (totally useless program).

I read that gconf editor might help but where to look? Searching for power returns no results. :(

Wow 5 rows and all start with I. :D (And this one would end with it. ;))

Thx for your time.
Zyzz
Level 1
Level 1
 
Posts: 29
Joined: Wed Aug 01, 2012 5:46 pm

Linux Mint is funded by ads and donations.
 

Re: Shutdown when Powerbutton is pressed

Postby xircon on Thu Aug 02, 2012 6:34 pm

Dell Inspiron N5010 / Core I5 / ATI Mobility Radeon HD5400, LMDE Tracking Sid & Cinnamon Desktop
"Ubuntu is an African word meaning 'I can't configure Debian'"
User avatar
xircon
Level 5
Level 5
 
Posts: 775
Joined: Sun Aug 01, 2010 7:59 am
Location: Sheffield, UK

Re: Shutdown when Powerbutton is pressed

Postby xircon on Thu Aug 02, 2012 7:11 pm

Works:
Code: Select all
`dbus-launch | sed "s/^/export /"`
GSETTINGS_BACKEND=dconf gsettings set org.gnome.settings-daemon.plugins.power button-power 'interactive'
GSETTINGS_BACKEND=dconf gsettings set org.gnome.settings-daemon.plugins.power button-hibernate 'interactive'
gsettings list-recursively org.gnome.settings-daemon.plugins.power


Gets the power button to pull up an interactive dialog box.
Dell Inspiron N5010 / Core I5 / ATI Mobility Radeon HD5400, LMDE Tracking Sid & Cinnamon Desktop
"Ubuntu is an African word meaning 'I can't configure Debian'"
User avatar
xircon
Level 5
Level 5
 
Posts: 775
Joined: Sun Aug 01, 2010 7:59 am
Location: Sheffield, UK

Re: Shutdown when Powerbutton is pressed

Postby Zyzz on Thu Aug 02, 2012 7:54 pm

Thx for your reply. I'm gonna test that (when I shutdown ^^). But instead of interactive I will use shutoff. The dialog option is nothing I like. :)
Zyzz
Level 1
Level 1
 
Posts: 29
Joined: Wed Aug 01, 2012 5:46 pm

Re: Shutdown when Powerbutton is pressed

Postby Zyzz on Sat Aug 04, 2012 5:06 pm

Alright I tested it 2 days now. Even with the option "shutdown" it gives me this dialog. Better than suspend as I take my pc of the power grid (is that the correct word?) every night and a restart gave me an error once because of that already.

I changed all power buttons to shutdown (with dconf editor at the section the link you gave me pointed me to). With LM 12 and Cinnamon I was able to use this:

Code: Select all
Create a file in /etc/acpi/events/ named powerbtn

gksudo gedit /etc/acpi/events/powerbtn

with following content:

# /etc/acpi/events/power
# This is called when the user presses the power button
event=button/power (PWR.||PBTN)
action=/sbin/poweroff

Restart acpid

sudo service acpid restart


But that doesn't work and gives me an error when booting resulting in a restart (which then works).

Any other ideas? Am I the only one who shuts his pc down with the power button? Why is it that complicated? :(


EDIT: https://bugzilla.gnome.org/show_bug.cgi?id=662098

Reading comment 4 there makes me really angry. What is this? Is gnome3 (what a shame Cinnamon is based on this §$%§$%) turning into mac where I'm not allowed to choose what I want? If I as user choose to change the DEFAULT 'interactive' to 'SHUTDOWN', it's MY choice to have the risk of losing data not theirs.
Is there a DE with gnome2 usability and not mac like guys that forbid everything like gnome3? (MATE is no choice as it's no longer supported.)

(Sry I'm a bit at rage atm.)

EDIT: https://bugs.archlinux.org/task/26671

How can I revert that? Any chance of editing a file to remove this stupid patch?
Zyzz
Level 1
Level 1
 
Posts: 29
Joined: Wed Aug 01, 2012 5:46 pm

Re: Shutdown when Powerbutton is pressed

Postby xircon on Sat Aug 04, 2012 5:58 pm

Code: Select all
`dbus-launch | sed "s/^/export /"`
GSETTINGS_BACKEND=dconf gsettings set org.gnome.settings-daemon.plugins.power button-power 'shutdown'
GSETTINGS_BACKEND=dconf gsettings set org.gnome.settings-daemon.plugins.power button-hibernate 'shutdown'
gsettings list-recursively org.gnome.settings-daemon.plugins.power


Copy and paste the above into a terminal. Yes it still brings up the dialog box, but after 60 seconds my machine shuts down.

Steve
Dell Inspiron N5010 / Core I5 / ATI Mobility Radeon HD5400, LMDE Tracking Sid & Cinnamon Desktop
"Ubuntu is an African word meaning 'I can't configure Debian'"
User avatar
xircon
Level 5
Level 5
 
Posts: 775
Joined: Sun Aug 01, 2010 7:59 am
Location: Sheffield, UK

Re: Shutdown when Powerbutton is pressed

Postby Zyzz on Sat Aug 04, 2012 6:14 pm

That's what I've already done.

I may have found something. acpi is handling my power buuton so this should be run once I push it right?

/etc/acpi/powerbtn-acpi-support.sh

If I now comment all but
Code: Select all
   # Normal handling.
   /sbin/shutdown -h -P now "Power button pressed"


It should shutodwn as usual right? Well I just give it a try and report tomorrow (yes I'm lazy and won't shutdown just for testing *g*).

Sry again for the aggressive writing in my last post.

EDIT: That' what I'm testing next:
https://wiki.archlinux.org/index.php/Sh ... wer_Button
Zyzz
Level 1
Level 1
 
Posts: 29
Joined: Wed Aug 01, 2012 5:46 pm

Re: Shutdown when Powerbutton is pressed

Postby xircon on Sat Aug 04, 2012 6:18 pm

Don't know, but the Arch wiki did say:
Warning: Please note that the acpid daemon also handle the "power button" and "hibernate button" event. Running both systems at the same time may lead to unexpected behaviour.


I suspect this is the root of your problem, though acpid is running on mine and causes me no problem.

Steve
Dell Inspiron N5010 / Core I5 / ATI Mobility Radeon HD5400, LMDE Tracking Sid & Cinnamon Desktop
"Ubuntu is an African word meaning 'I can't configure Debian'"
User avatar
xircon
Level 5
Level 5
 
Posts: 775
Joined: Sun Aug 01, 2010 7:59 am
Location: Sheffield, UK

Re: Shutdown when Powerbutton is pressed

Postby Zyzz on Sat Aug 04, 2012 6:24 pm

So if I deactivate acpi it may work with the first solution you posted? Isn't acpi handling my hdds too? (At least it's activated in UEFI.)
Do you have acpi not activated at all (is that the default?)?
I fear deinstaling it may cause even worse things (I don't know what else acpi does handle). :(

EDIT: Well I just read the wiki now I guess. *g*

EDIT2: Deinstalled acpid now and will report back towrrow. If it didn't work I start editing some files. :)
Last edited by Zyzz on Sat Aug 04, 2012 6:29 pm, edited 1 time in total.
Zyzz
Level 1
Level 1
 
Posts: 29
Joined: Wed Aug 01, 2012 5:46 pm

Re: Shutdown when Powerbutton is pressed

Postby xircon on Sat Aug 04, 2012 6:29 pm

Yes acpi is running on my machine, but is not causing any problems - it just works and I can't explain it.
Code: Select all
ps aux | grep acpi
root      3545  0.0  0.0   3920    76 ?        Ss   23:02   0:00 /usr/sbin/acpi_fakekeyd
root      3637  0.0  0.0   4364   984 ?        Ss   23:02   0:00 /usr/sbin/acpid


Sorry but I am stumped.

Steve
Dell Inspiron N5010 / Core I5 / ATI Mobility Radeon HD5400, LMDE Tracking Sid & Cinnamon Desktop
"Ubuntu is an African word meaning 'I can't configure Debian'"
User avatar
xircon
Level 5
Level 5
 
Posts: 775
Joined: Sun Aug 01, 2010 7:59 am
Location: Sheffield, UK

Re: Shutdown when Powerbutton is pressed

Postby Zyzz on Sat Aug 04, 2012 6:31 pm

Hehe ok. ;)
Btw I like your signature. :D
Zyzz
Level 1
Level 1
 
Posts: 29
Joined: Wed Aug 01, 2012 5:46 pm

Re: Shutdown when Powerbutton is pressed

Postby xircon on Sat Aug 04, 2012 8:02 pm

Good isn't it :) I am an ex-mandriva user, jumped ship when they were going under and the Mageia project seemed to be taking forever. I tried Ubuntu (I thought I would go "main stream") but found the forums unbearable :( Full of (spotty, annoying) kids (I am just a miserable old git!!!).

I like forums to be friendly, helpful and a good base for finding information. I really hate forums where idiotic prats just post "google it" in response to a query, I like this forum purely due to the number of nice friendly people, who have a low expectation of a users knowledge :)

BTW I don't think in anyway that your question fits any of the above, it is just my explanation of why I chose my signature!

So........... to the point:

If acpi is causing the problem, try removing (but copy it somewhere safe first):
/etc/acpi/events/powerbtn-acpi-support
Mine says:
Code: Select all
event=button[ /]power
action=/etc/acpi/powerbtn-acpi-support.sh


Then perhaps remove:
/etc/acpi/powerbtn-acpi-support.sh
And let dconf/gconf handle the management of the button - might work (probably won't!!) but worth a try!

Steve

PS Angry rant accepted - we run an operating system that should give us choices! If it doesn't..................... might as well run windows (Nooooooooooooo!)

Good night!
Dell Inspiron N5010 / Core I5 / ATI Mobility Radeon HD5400, LMDE Tracking Sid & Cinnamon Desktop
"Ubuntu is an African word meaning 'I can't configure Debian'"
User avatar
xircon
Level 5
Level 5
 
Posts: 775
Joined: Sun Aug 01, 2010 7:59 am
Location: Sheffield, UK

Re: Shutdown when Powerbutton is pressed

Postby Zyzz on Wed Aug 08, 2012 5:01 pm

Ok the acpi deinstallation didn't work. Your next idea is now on the trial. :D (Sry had a few days no motivation tuning my OS. ;))

I myself started with Ubuntu switching from Win98 (WinXP was evil back then). I tried other distrubutions but didn't get warm with them (Suse omg....). But since Ubuntu got Unity and Gnome3 I can't stand it anymore. Maybe these devs should work for Apple. ;)

After the powerbutton I have to work on undervolting (I don't know if Linux supports Cool and Quiet when I undervolt in UEFI(BIOS)).
Then I need a few funky applets and I'm set I think :D

EDIT: In case anyone is interested: Solution 1 of this here works for me now: https://wiki.archlinux.org/index.php/Sh ... wer_Button It's not the nicest solution as the popup still comes and then the shutdown happens but whatever. :)
Zyzz
Level 1
Level 1
 
Posts: 29
Joined: Wed Aug 01, 2012 5:46 pm

Linux Mint is funded by ads and donations.
 

Return to Newbie Questions

Who is online

Users browsing this forum: No registered users and 7 guests