11

I am using xubuntu 11.10. I'd like to be able to switch users, and I'd like to be able to do this within the xfce user interface. I read somewhere that there might be an applet I can install, but I cannot seem to find it. Can someone help?

11

enter image description here

In a terminal:

sudo apt-get install xfswitch-plugin

During installation it will ask you to switch window manager - do not choose GDM, but stick with lightdm. N.B. since its a text screen press TAB to navigate to "OK" and press ENTER

Right-click and add a new panel item - User Switching

2
  • Great! Now if only there was a way to add that to the Logout/Suspend/Hibernate menu instead of having it a separate entry...
    – weronika
    May 17 '12 at 22:37
  • 3
    CAREFUL WITH THAT AXE, EUGENE! This will bring in the entire heavyweight Gnome... That's a bad choice if you run XFCE. Sep 7 '13 at 16:45
5

You can click your user name in the top panel and then select "Lock Screen." From the locked screen select "New Login" and it will take you back to the LightDM screen where you can click a different user name and enter the password. The first user is still logged in and you can switch back and forth this way.

1
  • 1
    Switching back to my own session does require typing my password twice, though... (LightDM requires a password to get into my session, and xscreensaver does too).
    – Martijn
    Mar 11 '12 at 18:15
5

If you don't want to bring in the whole of gdm and dependencies, you can just create a launcher that achieves the same thing. Put this

#!/bin/sh
zenity --question --text "Switch user?" --title "New login" &&
gdmflexiserver --new

into a file called fast-user-switch, then do

chmod +x fast-user-switch
sudo mv fast-user-switch /usr/local/bin/

Then add a Launcher plugin to your panel, edit the menu and click the button with a white paper with a plus on it, there you can just type in fast-user-switch (it should auto-complete while you type if you did the past steps correctly), and select a nice icon (search for switch for a fitting one …)

Note: The next version of XFCE, 4.10, will include a Switch User button in the Actions plugin, and deprecate the session menu.

Note to the note: if you have kdm instead of gdm/lightdm (kdm+xfce may be an odd combination, but it happens), the 4.10 Switch User button doesn't work. However, the following bash script works, and additionally lets you either log in as a currently logged in user, or start a new login:

#!/bin/bash

set -f              # no globbing, so we can safely use *

# other_local[joe]=:0, other_local[bob]=:1 etc. for all active local
# users other than us:
unset other_local; declare -A other_local; 
while read -rd $'\t'; do
    IFS=$',\n' r=($REPLY)
    [[ "${#r[@]}" -ge 4 && "${r[4]}" != '*' && "${r[2]}" != '' && "${r[0]}" != '' ]] && other_local[${r[2]}]=${r[0]}
done < <(kdmctl list alllocal)
IFS=$',\n' r=($REPLY)
[[ "${#r[@]}" -ge 4 && "${r[4]}" != '*' && "${r[2]}" != '' && "${r[0]}" != '' ]] && other_local[${r[2]}]=${r[0]}


user_choice=$( printf "%s\n" "${!other_local[@]}" "New login" |\
    zenity --list --column User --text 'Switch to an active user, or start a new login:' --title 'Switch user?' ) || exit 1

case $user_choice in
    "New login" ) kdmctl reserve ;;
    * ) kdmctl activate "${other_local[$user_choice]}" ;;
esac
2
  • 2
    Very nice! No need to install gdm this way...
    – Martijn
    Mar 11 '12 at 18:13
  • Awesome. The 2-line script worked like a charm on default installation of Ubuntu 12.04 LTS. Nov 20 '12 at 14:40
3

Lock screen, and when prompted to login, click "New login".

(Works on 12.04, but it probably works on 11.10 too)

3

gdmflexiserver did not work for me coz it was not there on my system.

I used dm-tool instead: https://bugs.launchpad.net/ubuntu/+source/xfswitch-plugin/+bug/1320560

0
3

Invoking dm-tool, with either the 'lock', or 'switch-to-greeter' option, will leave an xfce4 session vulnerable to a login without a password, as per the following bug report: https://bugs.launchpad.net/lightdm/+bug/904006.

Rather than chase the bug, the devs seem to be directing people to use light-locker, which is simple to use, and set up with secure defaults.

The following fix ensures that the 'switch user' option in the xfce4 panel invokes light-locker. There is no need to create a launcher plugin, or install additional gnomeware.

(1) Install light-locker (in my case from the Debian 8/Jessie stable repository).

(2) Replace /usr/local/bin/gdmflexiserver with:

#!/bin/bash
light-locker-command -l
# [End]

(3) reboot (full shutdown and restart, needed once only, to get the panel to activate the 'switch user' option - you may have smarter ways to get this done).

Each time I hit the 'switch user' menu option, there is a slight pause on a black screen before the login appears, which is not there when I use dm-tool, but it's good to know my session is fully locked.

Thanks to pomidorabelisima at https://bugs.launchpad.net/ubuntu/+source/xfswitch-plugin/+bug/1320560 (duplicate bug report) for the heads-up.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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