Index: /neercs/trunk/src/configuration.c
===================================================================
--- /neercs/trunk/src/configuration.c	(revision 2499)
+++ /neercs/trunk/src/configuration.c	(revision 2500)
@@ -283,4 +283,9 @@
             /* if timeout is 0, set it to 0xFFFFFFFFFFFFFFFF */
             if(!screen_list->screensaver_timeout) screen_list->screensaver_timeout-=1;
+        }  else if(IS_TOKEN("autolock_timeout"))
+        {
+            screen_list->autolock_timeout = atoi(option->value) * 1000000;
+            /* if timeout is 0, set it to 0xFFFFFFFFFFFFFFFF */
+            if(!screen_list->autolock_timeout) screen_list->autolock_timeout-=1;
         } else if(IS_TOKEN("socket_dir"))
         {
Index: /neercs/trunk/src/neercsrc
===================================================================
--- /neercs/trunk/src/neercsrc	(revision 2499)
+++ /neercs/trunk/src/neercsrc	(revision 2500)
@@ -12,4 +12,5 @@
 window_manager = hsplit   ; full card  hsplit vsplit
 status_bar = true         ; Activate status bar
+autolock_timeout = 120    ; Lock session after 100 seconds
 
 [eyecandy]                ; Not-that-useful stuff
Index: /neercs/trunk/src/neercs.h
===================================================================
--- /neercs/trunk/src/neercs.h	(revision 2499)
+++ /neercs/trunk/src/neercs.h	(revision 2500)
@@ -81,4 +81,5 @@
     int locked;
     int lock_offset;
+    long long unsigned int  autolock_timeout;
     char lockpass[1024];
     char lockmsg[1024];
Index: /neercs/trunk/src/main.c
===================================================================
--- /neercs/trunk/src/main.c	(revision 2499)
+++ /neercs/trunk/src/main.c	(revision 2500)
@@ -119,4 +119,5 @@
     }
 
+
     screen_list->recurrent_list = (struct recurrent_list*) malloc(sizeof(struct recurrent_list));
     screen_list->recurrent_list->recurrent = (struct recurrent**) malloc(sizeof(struct recurrent*));
@@ -304,5 +305,4 @@
 
     last_key_time = get_us();
-
 
     for(;;)
@@ -420,5 +420,4 @@
 
             }
-
             if((get_us() - last_key_time > screen_list->screensaver_timeout))
             {
@@ -431,4 +430,11 @@
                 refresh = 1;
             }
+
+            if((get_us() - last_key_time > screen_list->autolock_timeout))
+            {
+                screen_list->locked = 1;
+                refresh = 1;
+            }
+
         }
 
@@ -542,4 +548,7 @@
     screen_list->default_shell = NULL;
 
+    screen_list->autolock_timeout = -1;
+
+
     screen_list->recurrent_list = NULL;
     screen_list->cv = NULL;
