In Gnome Shell, the keyboard shortcut to log out is specified in Settings, but this brings up the option to restart or shutdown. Is there a way to log out instead?
From the cursory search it looks like there’s no shortcut to log off by default in Gnome. And the shortcut that says “Logout” is actually used for restarting/turning off the system.
But the good news is you can easily add a logout shortcut yourself. In the same Setting dialog with all the shortcuts you add a new entry, name it as you see fit, enter the following command:
then add the key combination you want and save it. It works right away, checked right now.
If you don’t want logout confirmation dialog showing up, you can also add
--no-prompt (I personally wouldn’t to save myself from accidental keypresses, but it’s up to you).
If you need more detailed instructions for adding new shortcut – please tell so.
Adding some information to your answer, You can create a alias in your .bashrc, edit it and add in any place:
alias out="gnome-session-quit --logout"
all shortcut availables:
Unfortunately, the shortcut list does say “logout”, but it brings up the “power off” bits. I think that is what @fasulia is referring to:
@FranciscoD, thanks, I’ve changed the wording to avoid confusion. I’ve actually meant “there’s no such shortcut as you want”, and I did understand which one confused @fasulia.
Thanks @nightromantic that solution is perfect.
It is confusing that the Settings have a mis-named Log Out keyboard shortcut. Especially since Log Out and Shutdown(Restart) are common keyboard shortcuts that both existed before on Gnome, and still do on MATE.
Was there a screen overlay that showed keyboard shortcuts? I think some distro or window manager had that, not sure if it was Gnome.
@fasulia, you’re welcome!
I totally wholeheartedly agree))
Interesting detail is that Design page on gnome’s wiki lists two shortcuts, current one as “Power Off” – which it really is, and another one for “Log Off” – which has no shortcut assigned.
I assume they somehow got confused with labels.
I first heard about screen overlay with keyboard shortcuts in connection with Unity desktop of Ubuntu. Not sure if it was done somewhere else before or after that.