URI:
       Make both colons blink when -s (seconds) enabled and simplify the logic by setting a variable for the dot color. - 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 e844687f88c6611efb9a0e27c5d123501f123ecf
   DIR parent 4e6b4cae8aad23bd52ab17134ea32ef5619fcfb0
  HTML Author: Wessels <dwessels@verisign.com>
       Date:   Mon,  2 Mar 2015 14:55:13 -0800
       
       Make both colons blink when -s (seconds) enabled and simplify the
       logic by setting a variable for the dot color.
       
       Diffstat:
         M ttyclock.c                          |      26 +++++---------------------
       
       1 file changed, 5 insertions(+), 21 deletions(-)
       ---
   DIR diff --git a/ttyclock.c b/ttyclock.c
       @@ -253,30 +253,14 @@ draw_clock(void)
             /* Draw hour numbers */
             draw_number(ttyclock->date.hour[0], 1, 1);
             draw_number(ttyclock->date.hour[1], 1, 8);
       +     chtype dotcolor = COLOR_PAIR(1);
       +     if (ttyclock->option.blink && time(NULL) % 2 == 0)
       +        dotcolor = COLOR_PAIR(2);
        
       -     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));
       +       wbkgdset(ttyclock->framewin, dotcolor);
               mvwaddstr(ttyclock->framewin, 2, 16, "  ");
               mvwaddstr(ttyclock->framewin, 4, 16, "  ");
       -     }
        
             /* Draw minute numbers */
             draw_number(ttyclock->date.minute[0], 1, 20);
       @@ -299,7 +283,7 @@ draw_clock(void)
             if(ttyclock->option.second)
             {
                  /* Again 2 dot for number separation */
       -          wbkgdset(ttyclock->framewin, COLOR_PAIR(1));
       +          wbkgdset(ttyclock->framewin, dotcolor);
                  mvwaddstr(ttyclock->framewin, 2, NORMFRAMEW, "  ");
                  mvwaddstr(ttyclock->framewin, 4, NORMFRAMEW, "  ");