(a.k.a. How to switch users without entering password, part II) (see part I)
I've got Ubuntu 9.10 with a user account for my wife, and one for myself. "Wake-from-screensaver" should result in "choose user" without having to enter any password. I know how to do that in Windows, but I'm not good with Linux (yet).
Part of this was answered in my earlier question which helped me get past the login screen without passwords (after booting, and after choosing "switch user"), but once the screensaver kicks in and I wake it up again, the system does not present the "choose user" screen. Instead, it either turns off the screensaver and presents the desktop of the most recent user, or (if the screensaver is set to lock the screen) prompt for the user's password (which can be handily surpassed by clicking the "switch user" button and choosing the same user again).
So, the login ("choose user") screen has been dealt with. How do I make the (any) screensaver return to the login screen at wake, rather than to the current user's desktop? Windows can do this, I'm sure Linux can too – but how?
Best Answer
You're making a habit of weird tweaks, aren't you?
Anyway, this one is weird, but interesting. I'm sorry to say I don't have a complete solution, but I found a couple of interesting items that warrant a response. They may give you some ideas of where to go from here.
Gnome-Screensaver's FAQ indicates that the screensaver emits a DBus signal when the session's idle status changes:
The FAQ provides an example dbus-monitor command:
Although I believe the interface and member details are outdated for Ubuntu 9.10; the proper values seem to be interface=org.freedesktop.ConsoleKit.Session and member=IdleHintChanged. (See the ConsoleKit documentation.)
When the screensaver lock is enabled, the IdleHintChanged signal is emitted after the password is entered successfully into the unlock dialogue.
The command gdmflexiserver -xnest can be used from the commandline to get back to the login screen. It works within your X session by itself, but you can use dbus-launch to execute it from, say, an SSH session:
That "activates" the GDM login screen, without logging the current user session out, just like the "Switch User..." menu option does (at least as far as I can tell).
The trick will be to find some way to glue these two together. It seems to me that what you'd want to do is basically:
Step 1 is needed so you don't get the password prompt. If step 2 works properly and step 3 kicks off, you'll get the login window anytime your system comes out of the screensaver. But step 2 is what I'm not sure how to do.