Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I share my home computer with my wife, and we often switch between our two accounts.
I'm considering using Ubuntu on my next computer, and I'm evaluation different desktop environments (E.g. Gnome, Unity, or Xfce).
Fast user switching is a deal breaker for me on most of the desktop environments. In Unity it is best - you always have a menu with all users, and you can switch with a single click (assuming no passwords):

Unity user switching

On Gnome and Xfce it's quite bad. I need to click on "Switch User", select the other user, and click "Login" - all involving tiny buttons on different positions of the screen.

Is there a way of switching users quickly - preferably with a single click and/or a hotkey? Is there anything that would work regardless of desktop environment?

I've found a similar question: Keyboard shortcut to switch user accounts - but it only goes as far as the display manager. I want to skip it and switch to the other user's session.

share|improve this question
up vote 11 down vote accepted

Not a single click, but I can give you a keyboard shortcut solution.

Go into the menu to set custom keyboard shortcuts

and add a new one with this command:

dm-tool switch-to-user suzi

Assuming suzi is your wife's username, and set a shortcut of your choice by clicking where is says "disabled" and then pressing the key combination you want to use (for example, super+alt+S if the user's initial is S). Set another shortcut to switch to your own account (with your own username in the command).

share|improve this answer
    
Thanks! I knew there should be something simple, but couldn't find it. This is working very nicely in Xfce an Unity (I'm testing in VirtualBox). Gnome is less happy but I can probably get it to work as well. – Kobi 7 hours ago
3  
@Kobi ah awesome - I just learned about this yesterday when digging through old questions so perfect timing. I'm finding it very useful too (I use MATE) – Zanna 7 hours ago
    
Another note - this works in desktop environments that have lightdm installed. If I understand correctly, I wouldn't want to install it in systems like KDE, it might break something (?). It works in my case, but just because I tend to prefer these desktop environments. Thanks again. – Kobi 3 hours ago
    
@Kobi good point, not tested it with any other dm – Zanna 3 hours ago

You can us a Function Key combination. F1 is the first DISPLAY, then F2, F3, etc.

If you were the first one logged in your DISPLAY would be F1. The next user's DISPLAY would be F2.

So you can quickly swwitch between user's by hitting Alt+Ctrl+F#

With this method you can save having to login when switching between sessions.

share|improve this answer
    
This also works. F6-F7 worked for me, F1-F5 were terminals. I prefer something more deterministic though. – Kobi 3 hours ago
    
TTY1-TTY6 are text terminals, only TTY7-TTY12 are usedfor graphical sessions normally, starting with TTY7 for the first session and adding more on demand. – Byte Commander 1 hour ago
    
@Kobi I had mentioned the defaults in my answer. Linux is full of surprises. So it's possible to program alternate configurations for the mappings. – L. D. James 1 hour ago

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.