Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

What's the best/right way to configure GNOME/Unity so that hitting ALT + F4 will Power Off the system when no more windows are open? (pop up the Power-Off dialog).

(running Ubuntu 12.04.1)

share|improve this question
    
You want to do it only when there are no windows open? –  Seth Jan 2 '13 at 3:39
add comment

1 Answer 1

up vote 1 down vote accepted

No.There is no short-cut for Power-off. But you could add one.

Go to System Settings ----> Keyboard -----> Click on the shortcuts tab ----> Click on the + button.

Now enter some name of the shortcut and the command gnome-session-quit --power-off --force.

Now you can apply whatever keyboard shortcut you want to it. Click on the word that says Disabled... when you click New accelerator... will be shown. Now you assign it to whatever keyboard shortcut you want to it (that is by pressing Alt + F4 when you see the word New accelerator...)

share|improve this answer
    
Well, that works, but it tells me "this shortcut is already in use and setting a new command would overwrite the current" (which is close-window for alt+f4) .. Is there a way to have it hierarchical, as in Xfce etc., so it only triggers the session-quit when no windows are opened? Else: Accepted answer! –  isync Jan 2 '13 at 1:35
    
I’m not sure if there is any way to have it hierarchical. –  Mukund Jan 2 '13 at 6:33
    
So there's no way to replicate behaviour of Xfce, Windows, et al. Well, thanks anyway --acepted as best answer. –  isync Jan 3 '13 at 23:58
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.