Page 1 of 1

Gnome: lock session at startup

Posted: 24 Apr 2009, 19:30
by voria
There is a new custom package on my repository, gnome-settings-daemon, containing a patch written by me that allow to lock the session immediately after login.

The reason is simple: When I start my pc, I usually press the power button, then I go to do other stuff while it's booting.
With autologin enabled in gdm and session locked after login, I only have to insert my password to start to work.
The desktop session is already fully loaded and, when I'm on battery, the screen brightness is correctly set by gnome-power-manager.

To lock the session I just have to add the following command to 'Startup Applications':

Code: Select all

gnome-screensaver-command --lock
the problem is that 'gnome-screensaver' has to be already started or else it does not work.

Everything worked good in gnome 2.24.x; in version 2.26.x 'gnome-screensaver' is started with a 30 seconds delay in order to make other stuff load faster.
This ruins all the plans.

My patch adds a timeout option that allow to set the delay (in seconds) before 'gnome-screensaver' is started. It defaults to 30 seconds.
If it's set to 0, 'gnome-screensaver' gets loaded instantly, so the session can be locked with no problems.

For completeness, this is the new gconf key:

Code: Select all

/apps/gnome_settings_daemon/screensaver/start_screensaver_timeout