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.

In Ubuntu 11.04, Ctrl-Alt-Del gives me a menu with shutdown, hibernate, suspend and restart, but no logout. Is there a key combination to logout of Ubuntu? Is there a way to provide one?

share|improve this question
    
If future searchers want to know. I can type Ctrl+Alt+L in 12.04 to lock screen. –  AWE Aug 26 at 6:33

5 Answers 5

up vote 17 down vote accepted

Creating custom keyboard shortcuts:

For 11.04:

To add a new shortcut open System -> Preferences -> Keyboard Shortcuts and press Add:

enter image description here

In the opening window type in your custom command name and the command you want to run (e.g. gnome-session-save --logout to logout immediately).

Press on the Shortcut line of your new shortcut and press the key combination you want to use (here Alt + Backspace). If it already exists you will get a warning.

enter image description here

Choose Add to add a new shortcut, give the commands mentioned and choose your key combination.

You may neeed to reboot your system for a shortcut to take effect


For 11.10 and later:

To add a new shortcut open System Settings -> Keyboard and choose the Shortcuts tab:

enter image description here

Press the '+' sign on the bottom left to enter the name of your custom shortcut and the command you want to run (e.g. gnome-session-quit --logout --no-prompt). After having applied this you are able to select the line of your new shortcut. Then press the desired key combination.

Note: The default keyboard shortcut to logout with a 60s timeout is Ctrl + Alt + Del in 11.10.

share|improve this answer
    
Thanks for the effort of putting this answer together! I'd be interested to know if "System Settings -> Keyboard -> Shortcuts tab"... described here has the same effect as "Gnome Control Center -> Keyboard" described by @enzotib (for 11.10) –  drevicko Oct 20 '11 at 2:54
    
@drevicko The menu entry System Settings calls the Gnome Control Center, so yes, its the same. –  Takkat Oct 20 '11 at 6:11
    
Excellent It the same trick for 12.04. –  Papachan May 6 '12 at 13:07

In Ubuntu 1204 there are two out-of-the-box solutions:

  1. "Run a command" technique:

    Alt-F2 | type gnome-session-quit

  2. "Indicator menu" technique:

    Alt-F10 | arrow right or left to gear icon | arrow down to Log Out...

In each case, confirm logout by hitting Enter. A bug in Ubuntu for #1 is that if you login and do nothing and hit Alt-F2 you get Dash (to run programs). Just hit Esc and try again with Alt-F2 and you'll get the "Run a command" instead this time.

share|improve this answer

If you are using Unity (the default environment in Ubuntu 11.04 and later) then you can press the Super key (aka the Windows key) to bring up the dash, type in "log" and the first option is "Log Out" so just press Enter. This will bring up a dialog box to confirm whether you want to log out, with the "Log Out" button already selected, so press Enter again. And you're logged out.

share|improve this answer
    
"Log Out" does not appear in my dash.. –  drevicko Oct 20 '11 at 2:52
    
@drevicko: I've only actually tested this on 11.10, so it is possible it doesn't works with 11.04. –  Hamish Downer Oct 20 '11 at 16:55

I think You can just make custom shortcut for "gnome-session-quit --logout --no-prompt" without any bash scripting.

share|improve this answer

In Ubuntu 11.10 you could write a script containing

#/bin/bash
gnome-session-quit --logout --no-prompt

make it executable with chmod +x script-name, then set a global shortcut to execute this script in Gnome Control Center -> Keyboard.

In previous Ubuntu versions there was gnome-session-save --logout.

share|improve this answer
    
In 11.10 the default action on Ctrl+Alt+Del is to logout. –  Takkat Oct 19 '11 at 7:09
    
@Takkat: you're right, I assumed the OP do not want it to ask for confirmation. –  enzotib Oct 19 '11 at 7:26

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.