--- wmCalClock-1.25/Src/wmCalClock.c.orig	Fri Jul  2 23:01:35 1999
+++ wmCalClock-1.25/Src/wmCalClock.c	Sat Jul  6 23:06:37 2002
@@ -277,6 +277,7 @@
 int     GotFirstClick3, GotDoubleClick3;
 int     DblClkDelay;
 int     HasExecute = 0;		/* controls perf optimization */
+int     UseGeekTime = 0;
 char	ExecuteCommand[1024];
 
 
@@ -284,7 +285,8 @@
 char    BackgroundColor[30]    	= "#181818";
 
 
-
+int TimeDiff;
+int WakeUpHour = 9;
 
 
 
@@ -505,6 +507,9 @@
 	    } else {
 
                 CurrentLocalTime = time(CurrentTime);
+								if(UseGeekTime == 1) {
+								CurrentLocalTime -= TimeDiff;
+								}
 	        Time = localtime(&CurrentLocalTime);
 	        DayOfMonth = Time->tm_mday-1;
 	        DayOfWeek = Time->tm_wday;
@@ -850,7 +855,15 @@
 
 	    UseLowColorPixmap = 1;
 
-        } else {
+				} else if (!strcmp(argv[i], "-wakeuphour")){
+		 
+					WakeUpHour = atoi(argv[++i]) ;
+
+				} else if (!strcmp(argv[i], "-geektime")){
+
+					UseGeekTime = 1;
+
+        } else  {
 
 	    print_usage();
             exit(1);
@@ -870,8 +883,8 @@
 
     printf("\nwmCalClock version: %s\n", WMCALCLOCK_VERSION);
     printf("\nusage: wmCalClock [-b <Volume>] [-tc <Color>] [-bc <Color>] [-e \"Command\"] [-S]\n");
-    printf("         [-24] [-g] [-s] [-l <longitude>] [-l] [-jazz] [-tekton] [-luggerbug]\n");
-    printf("         [-arial] [-comicsans] [-h]\n\n");
+    printf("         [-24] [-g] [-s] [-l <longitude>] [-l] [-geektime] [-jazz] [-tekton] [-luggerbug]\n");
+    printf("         [-arial] [-comicsans] [-wakeuptime <Hour>] [-h]\n\n");
     printf("\t-b <Volume>\tBeep on the hour. Volume is between -100 to 100.\n");
     printf("\t-tekton\t\tUse the Tekton font for time field.\n");
     printf("\t-arial\t\tUse the Arial-Narrow (i.e. Helvetica-Narrow) font for time field.\n");
@@ -889,6 +902,8 @@
     printf("\t              \t\tLongitude is in degrees (- for West + for East).\n");
     printf("\t-l\t\tUse a low-color pixmap to conserve colors. On 8-bit displays the\n");
     printf("\t  \t\tlow color pixmap will always be used.\n");
+    printf("\t-geektime\tEnable geek time.\n");
+    printf("\t-wakeuphour <hour>\tSet the wake up hour of a geek (default: 9).\n");
     printf("\t-h\t\tDisplay help screen.\n");
     printf("\nExample: wmCalClock -b 100 -tc #001100 -bc #7e9e69 \n\n");
 
@@ -977,9 +992,12 @@
 void ButtonPressEvent(XButtonEvent *xev){
 
     char Command[512];
+		struct tm *TimeGeek;
+		int GeekHours, GeekMin, GeekSecs;
+		long GeekTime;
 
 
-    if( HasExecute == 0) return; /* no command specified.  Ignore clicks. */
+    if( HasExecute == 0 && UseGeekTime == 0) return; /* no command specified.  Ignore clicks. */
     DblClkDelay = 0;
     if ((xev->button == Button1) && (xev->type == ButtonPress)){
         if (GotFirstClick1) GotDoubleClick1 = 1;
@@ -996,7 +1014,7 @@
     /*
      *  We got a double click on Mouse Button1 (i.e. the left one)
      */
-    if (GotDoubleClick1) {
+    if (GotDoubleClick1 && HasExecute == 1) {
         GotFirstClick1 = 0;
         GotDoubleClick1 = 0;
         sprintf(Command, "%s &", ExecuteCommand);
@@ -1021,6 +1039,19 @@
         GotDoubleClick3 = 0;
     }
 
+    /*
+     *  We got a single click on Mouse Button3 (i.e. the left one)
+     */
+    if (GotFirstClick3 && UseGeekTime == 1) {
+        GotFirstClick3 = 0;
+				GeekTime = time(CurrentTime);
+				TimeGeek=localtime(&GeekTime);
+				GeekHours = TimeGeek->tm_hour;
+				GeekMin = TimeGeek->tm_min;
+				GeekSecs = TimeGeek->tm_sec;
+				GeekSecs = GeekHours*3600 + GeekMin*60 + GeekSecs;
+				TimeDiff=(GeekSecs - WakeUpHour*3600);
+    }
 
 
    return;
