How do I change/disable the timeout value for automatic shutdown after pressing the power button

Asked by Jack Hanison

If I press the power button on my laptop, or if I go to System->Shutdown, the dialog that appears "Shut Down the Computer" is set to automatically activate the shutdown action after 60seconds. I would like to be able to change the automatic action, configure the timeout duration and be able to disable this automatic action.

How can I do any or all of these things?

TIA
Jack

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Savvas Radevic (medigeek) said :
#1

What's the reason? Do you need more than 60 seconds to decide whether you'll click Restart or Shut down? :)
I believe what you need is either:
a) to change the behaviour of the power button in Ubuntu: http://ubuntuforums.org/showthread.php?t=197765
or
b) to set an application launcher shortcut in your panel with a command, such as the following (will shut down the computer):
gksu poweroff

Revision history for this message
Savvas Radevic (medigeek) said :
#2

By the way, I think the default action in the gnome shutdown dialog is the shutdown, so you can just press the Spacebar once the dialog shows up and it will power off the computer.

Revision history for this message
Savvas Radevic (medigeek) said :
#3

Sorry for the triple post, but as an addition to solution (a), you can go to System > Preferences > Power Management (or Screensaver > Power management) > General > Select what to do "when power button is pressed"

Revision history for this message
Jack Hanison (jack-hanison) said :
#4

Hi Savvas,

Thanks for the suggestions, however they're not really answering my question.

The problem that I have is that if I accidentally hit the power button on my laptop then it's going to shutdown when I don't want it to. Therefore, I'd like to be able to prevent this from happening.

Ideally I'd like to change the default to be suspend or hibernate rather than shutdown, but also I'd like to remove the timeout so that there is no default action.

Taking this idea further, perhaps I could use power profiles to change the behavior? So that when running on battery, I'd have the power button default to hibernate, and probably want to change the timeout to be less, perhaps just 10 seconds - I'd still want to be asked though rather than having the "when power button is pressed" option be set to hibernate, that way I can do something different in a certain situation.

Surely this behavior is customizable? Does anyone know how I customize this dialog box?

Jack

Revision history for this message
Savvas Radevic (medigeek) said :
#5

You can press the Esc key to cancel and close the shutdown dialog. The shutdown dialog can be run using:
gnome-session-save --shutdown-dialog

I'd suggest to adapt to using the keyboard keys for now:
ALT+S (or spacebar) Shuts down
ALT+R Restarts
ALT+H Hibernates
ALT+U Suspends

If you know programming, then yes, it can be customised :) Get source and start hacking: apt-get source gnome-session

Alternatively, you may want to add a feature request: http://bugzilla.gnome.org/simple-bug-guide.cgi

By the way, you can make your own shortcuts/application launchers at the panel (where it will be always available) and not click on them "accidentally" as you say, make it run a bash script file such as:
#!/bin/bash
zenity --question --text "Are you sure you want to shutdown?"
if [ $? -eq 0 ]; then gnome-session-save --shutdown-dialog; fi

You can always attach this to a custom keyboard shortcut, or any other command:
http://tombuntu.com/index.php/2008/03/14/create-custom-keyboard-shortcuts/
http://www.captain.at/howto-gnome-custom-hotkey-keyboard-shortcut.php

Revision history for this message
aoirthoir (boscagarda-ubuntu2135) said :
#6

Does anyone actually listen to questions on here?

YES we can hit esc to cancel. But when we hit it accidentally, maybe we also have another window that pops up in FRONT of it, and we don't even realize it came up. This JUST happened to me.

What IDIOT decided to set this to automatic AND make it so danged hard to change? Honestly I think with all the moronic changes lately in Ubuntu, Gnome, and KDE that yall people are being bribed by Microsoft to FORCE US BACK to MS.

HOW DO WE CHANGE THIS SO IT DOES NOT AUTOMATICALLY TURN OUR COMPUTERS OFF???????????????????//

Revision history for this message
aoirthoir (boscagarda-ubuntu2135) said :
#7

Jack,

Here is the only solution I've got right now, since I cannot find where to change the timeout to NOT MATTER.

Go to the gnome configuration via:

ALT-F2
gconf-editor

Click on apps
Click on gnome-power-manager
Click on buttons

On the right click on power
Hit ENTER

type in "nothing" (without the quotes)
Click Ok.

Now when you hit the power button nothing will happen. Not as great as being able to change the stupid moronic timeout I know, but at least it won't accidentally shut down your computer. You will have to use CTRL-ALT-DELETE or the mouse to shut it down.

Hope that helps, I am now going to kill myself with acid because it is less painful than using Gnome.

Revision history for this message
ljrossi (ljrossi-yahoo) said :
#8

""I would like to be able to change the automatic action, configure the timeout duration""

I will like to be able to change the 60 sec. When i do let some process, dowload, or bakups .
I need to for example shutdown with a 2 hour timebase.

Revision history for this message
Dimitrios Dalagiorgos (dimndal) said :
#9

I concur.

I'd also like to be able to easily disable the power button, and not just for the current user, but for every user of the system, even when no user is logged on (i.e. during the login screen).

Revision history for this message
ReneS (mail-03146f06) said :
#10

I would like to disable the automatic 60 second action too. Same for "Log out". It sometimes happens, that the dialog comes up behind other screens or someone distracts me while I am going to suspend/hibernate my notebook or activate the "Lock" - and hit "Log Off" instead but did not notice it, because both I got distracted.

Revision history for this message
ReneS (mail-03146f06) said :
#11

By the way, this is a nice paperclip bug...

Revision history for this message
Reid Kaufmann (reid-kaufmann) said :
#12

I'm not sure what "paperclip bug" means, but I'd also like to validate the need for a solution. I have a one year old daughter that like to press the power button.

ljrossi, you could probably use the shutdown command at the command line to time a shutdown (sudo shutdown +2:00).

Revision history for this message
Reid Kaufmann (reid-kaufmann) said :
#13

aoirthoir's solution with gconf-editor worked great for me.

Revision history for this message
ReneS (mail-03146f06) said :
#14

Sorry, the project is called "papercuts" and means that a bunch of small annoying defects is resolved to improve overall usability.

Revision history for this message
joel puente (joelpuente) said :
#15

I have the same problem.Microsoft never Put a shut down nag screen.And even if it did,it would give the user the option to change the settings.I think unbuntu could do a heck of a better job fixing this bug for average Joe's like me.
This happens to me a lot when I'm on a program like fl studio.I guess it might think I'm off of my computer since I'm on a program that uses wine.There SHOULD be a solution for this.

Revision history for this message
joel puente (joelpuente) said :
#16

I have the same problem.Microsoft never Put a shut down nag screen.And even if it did,it would give the user the option to change the settings.I think unbuntu could do a heck of a better job fixing this bug for average Joe's like me.
This happens to me a lot when I'm on a program like fl studio.I guess it might think I'm off of my computer since I'm on a program that uses wine.There SHOULD be a solution for this.

Revision history for this message
Alexandr Novel (normalex) said :
#17

aoirthoir, you are genius, I couldn't find the "nothing" value anywhere else (didn't check sources though). Thank you.

Can you help with this problem?

Provide an answer of your own, or ask Jack Hanison for more information if necessary.

To post a message you must log in.