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 am trying to create a keyboard shortcut in Xubuntu (13.04), but I have no idea what to put for the command. What is the command for invoking switch user?

share|improve this question
up vote 4 down vote accepted

I checked with the source code of the 'actions button' plugin built in to the xfce4-panel and the switch user mechanism uses gdmflexiserver, while most of the other actions use parameters to xfce4-session-logout.

The source was fetched with apt-get source xfce4-panel; the information was in ~/xfce4-panel-4.10.0/plugins/actions/actions.c:

      succeed = g_spawn_command_line_async ("gdmflexiserver", &error);

You will find the executable at /usr/lib/lightdm/lightdm/gdmflexiserver, which is actually just a script:

# Copyright (C) 2011 Canonical Ltd
# Author: Michael Terry <>
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, version 3 of the License.
# See for the full text of the license.

if [ -z "$XDG_SEAT_PATH" ]; then
      # something went wrong
      exit 1

dbus-send --system --type=method_call --print-reply --dest=org.freedesktop.DisplayManager $XDG_SEAT_PATH org.freedesktop.DisplayManager.Seat.SwitchToGreeter

It isn't in $PATH, so if you use it in a script, you will need to specify the absolute path. I am not sure whether it takes any other switches, but will add some further information if so.

Useful commands for scripts can also be found in the manpage for xfce4-session-logout, although the switch user action is not mentioned there, as it uses a different utility called gdmflexiserver.

share|improve this answer
Thanks for the excellent reply. That worked great. Also, I'm new to Xfce (and been away from linux for years) so knowing where to look as you've described is extremely helpful. Huge thanks! – Ryan Farley Apr 29 '13 at 23:20

Your Answer


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.