Gnome: lock session at startup

Discussions about Linux installation and configuration on Samsung laptops
Post Reply
User avatar
Posts: 1383
Joined: 12/02/2009, 18:08
Location: Italy

Gnome: lock session at startup

Post 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

Last edited by voria on 24/04/2009, 21:08, edited 1 time in total.
Please consider a little donation to keep the 'Linux On My Samsung' project up and running. Thank you!

Post Reply