URI:
       Merge pull request #14 from briancain/master - tty-clock - port of tty-clock to OpenBSD, with pledge/unveil added as goodie.
  HTML git clone https://git.drkhsh.at/tty-clock.git
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit 7a789dc0f89ad2c9742efaf8af8d5b0c1da010da
   DIR parent dfb623ab61d1a6f9e5adcb8063ba3c5da3bccb8d
  HTML Author: Martin Duquesnoy <xorg62@gmail.com>
       Date:   Mon, 17 Jun 2013 11:12:26 -0700
       
       Merge pull request #14 from briancain/master
       
       Adding Blinking Colon
       Diffstat:
         A .gitignore                          |       2 ++
         M README                              |      23 +++++++++++++----------
         M ttyclock.c                          |      39 +++++++++++++++++++++++++------
         M ttyclock.h                          |       1 +
       
       4 files changed, 48 insertions(+), 17 deletions(-)
       ---
   DIR diff --git a/.gitignore b/.gitignore
       @@ -0,0 +1,2 @@
       +tty-clock
       +tty-clock.dSYM/
   DIR diff --git a/README b/README
       @@ -1,10 +1,13 @@
       -usage : tty-clock [-sctrvih] [-C [0-7]] [-f format]
       -    -s            Show seconds
       -    -c            Set the clock at the center of the terminal
       -    -C [0-7]      Set the clock color
       -    -t            Set the hour in 12h format
       -    -r            Do rebound the clock
       -    -f format     Set the date format
       -    -v            Show tty-clock version
       -    -i            Show some info about tty-clock
       -    -h            Show this page
       +usage : tty-clock [-sctrvihDB] [-C [0-7]] [-f format]            
       +    -s            Show seconds                                   
       +    -c            Set the clock at the center of the terminal    
       +    -C [0-7]      Set the clock color                            
       +    -t            Set the hour in 12h format                     
       +    -r            Do rebound the clock                           
       +    -f format     Set the date format                            
       +    -v            Show tty-clock version                         
       +    -i            Show some info about tty-clock                 
       +    -h            Show this page                                 
       +    -d delay      Set the delay between two redraws of the clock 
       +    -D            Hide date                                      
       +    -B            Enable blinking colon                          
   DIR diff --git a/ttyclock.c b/ttyclock.c
       @@ -207,10 +207,29 @@ draw_clock(void)
             draw_number(ttyclock->date.hour[0], 1, 1);
             draw_number(ttyclock->date.hour[1], 1, 8);
        
       -     /* 2 dot for number separation */
       -     wbkgdset(ttyclock->framewin, COLOR_PAIR(1));
       -     mvwaddstr(ttyclock->framewin, 2, 16, "  ");
       -     mvwaddstr(ttyclock->framewin, 4, 16, "  ");
       +     if (ttyclock->option.blink){
       +       time_t seconds;
       +       seconds = time(NULL);
       +
       +       if (seconds % 2 != 0){
       +           /* 2 dot for number separation */
       +           wbkgdset(ttyclock->framewin, COLOR_PAIR(1));
       +           mvwaddstr(ttyclock->framewin, 2, 16, "  ");
       +           mvwaddstr(ttyclock->framewin, 4, 16, "  ");
       +       }
       +       else if (seconds % 2 == 0){
       +           /*2 dot black for blinking */
       +           wbkgdset(ttyclock->framewin, COLOR_PAIR(2));
       +           mvwaddstr(ttyclock->framewin, 2, 16, "  ");
       +           mvwaddstr(ttyclock->framewin, 4, 16, "  ");
       +       }
       +     }
       +     else{
       +       /* 2 dot for number separation */
       +       wbkgdset(ttyclock->framewin, COLOR_PAIR(1));
       +       mvwaddstr(ttyclock->framewin, 2, 16, "  ");
       +       mvwaddstr(ttyclock->framewin, 4, 16, "  ");
       +     }
        
             /* Draw minute numbers */
             draw_number(ttyclock->date.minute[0], 1, 20);
       @@ -437,14 +456,16 @@ main(int argc, char **argv)
             ttyclock->option.color = COLOR_GREEN; /* COLOR_GREEN = 2 */
             /* Default delay */
             ttyclock->option.delay = 40000000; /* 25FPS */
       +     /* Default blink */
       +     ttyclock->option.blink = False;
        
       -     while ((c = getopt(argc, argv, "tvsrcihfDd:C:")) != -1)
       +     while ((c = getopt(argc, argv, "tvsrcihfDBd:C:")) != -1)
             {
                  switch(c)
                  {
                  case 'h':
                  default:
       -               printf("usage : tty-clock [-sctrvihD] [-C [0-7]] [-f format]              \n"
       +               printf("usage : tty-clock [-sctrvihDB] [-C [0-7]] [-f format]            \n"
                              "    -s            Show seconds                                   \n"
                              "    -c            Set the clock at the center of the terminal    \n"
                              "    -C [0-7]      Set the clock color                            \n"
       @@ -455,7 +476,8 @@ main(int argc, char **argv)
                              "    -i            Show some info about tty-clock                 \n"
                              "    -h            Show this page                                 \n"
                              "    -d delay      Set the delay between two redraws of the clock \n"
       -                      "    -D            Hide date                                      \n");
       +                      "    -D            Hide date                                      \n"
       +                      "    -B            Enable blinking colon                          \n");
                       free(ttyclock);
                       exit(EXIT_SUCCESS);
                       break;
       @@ -497,6 +519,9 @@ main(int argc, char **argv)
                  case 'D':
                       ttyclock->option.date = False;
                       break;
       +          case 'B':
       +               ttyclock->option.blink = True;
       +               break;
                  }
             }
        
   DIR diff --git a/ttyclock.h b/ttyclock.h
       @@ -68,6 +68,7 @@ typedef struct
                  char *format;
                  int color;
                  long delay;
       +          Bool blink;
             } option;
        
             /* Clock geometry */