Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to make a simple script to go to the login screen and sleep the display on 11.10, as I find the login screen much prettier than the 'lock screen' prompt. However, I cannot find a single reference to switching to the login screen (without logging out) from a terminal or shell script.

I would also appreciate suggestions for sleeping the display after switching to the login screen, or as one whole script if possible.

Thanks

edit: This is with Unity 3D (as far as I know), I don't really know what the difference between that and Gnome is.

share|improve this question
    
I post it as a comment as it did not work on my machine but maybe on yours. The gnome-session-save command without arguments should do it, however, it doesnt. WHen using gnome-session-save --logout-screen, you get the change user option. Maybe someone can help further with this information... –  Michael K Dec 15 '11 at 8:57
    
my machine says it can't find the command, are you sure that is a command for unity 3d? As far as I know they (gnome and unity) are two different display managy thingies, maybe you can correct me. –  iamthepiguy Dec 18 '11 at 0:14
    
I am not an expert with gnome / unity etc. I am still using gnome classic and will soon turn away from ubuntu and head to Lubuntu with lxde window manager, because I cannot see a clear line in ubuntu's window manager choices. –  Michael K Dec 19 '11 at 7:58
    
Anyone? Please? –  iamthepiguy Dec 29 '11 at 4:01

1 Answer 1

You can do the following:

gnome-screensaver-command -l ; gdmflexiserver

gnome-screensaver-command -l will lock your session, and gdmflexiserver will take you to the login screen. Your session will be locked, but will unlock automatically when you enter your password at the login screen.

As a script:

#!/bin/sh
gnome-screensaver-command -l
gdmflexiserver
share|improve this answer

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.