URI:
       Added the screensaver mode - 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 2f2aaa09a08611eda7ab41f2c60693440c6ae254
   DIR parent a82fd716905a69d632d7a6641745d43a89ecaa18
  HTML Author: Skami18 <skami@skami-laptop.dyndns.org>
       Date:   Sat, 28 May 2011 15:12:34 +0200
       
       Added the screensaver mode
       
       Diffstat:
         M README                              |       3 ++-
         M ttyclock.c                          |      30 ++++++++++++++++++++++++++++--
         M ttyclock.h                          |       1 +
       
       3 files changed, 31 insertions(+), 3 deletions(-)
       ---
   DIR diff --git a/README b/README
       @@ -1,5 +1,6 @@
       -usage : tty-clock [-sctrvih] [-C [0-7]] [-f format]
       +usage : tty-clock [-sSctrvih] [-C [0-7]] [-f format]
            -s            Show seconds
       +    -S            Screensaver mode
            -c            Set the clock at the center of the terminal
            -C [0-7]      Set the clock color
            -t            Set the hour in 12h format
   DIR diff --git a/ttyclock.c b/ttyclock.c
       @@ -324,6 +324,28 @@ key_event(void)
             int i, c;
        
             struct timespec length = { 0, ttyclock->option.delay };
       +     
       +     if (ttyclock->option.screensaver)
       +     {
       +          c = wgetch(stdscr);
       +          if(c != ERR)
       +          {
       +               ttyclock->running = False;
       +          }
       +          else
       +          {
       +               nanosleep(&length, NULL);
       +               for(i = 0; i < 8; ++i)
       +                    if(c == (i + '0'))
       +                    {
       +                         ttyclock->option.color = i;
       +                         init_pair(1, ttyclock->bg, i);
       +                         init_pair(2, i, ttyclock->bg);
       +                    }
       +          }
       +          return;
       +     }
       +     
        
             switch(c = wgetch(stdscr))
             {
       @@ -420,14 +442,15 @@ main(int argc, char **argv)
             /* Default delay */
             ttyclock->option.delay = 40000000; /* 25FPS */
        
       -     while ((c = getopt(argc, argv, "tvsrcihfd:C:")) != -1)
       +     while ((c = getopt(argc, argv, "tvsSrcihfd:C:")) != -1)
             {
                  switch(c)
                  {
                  case 'h':
                  default:
       -               printf("usage : tty-clock [-sctrvih] [-C [0-7]] [-f format]              \n"
       +               printf("usage : tty-clock [-sSctrvih] [-C [0-7]] [-f format]             \n"
                              "    -s            Show seconds                                   \n"
       +                      "    -S            Screensaver mode                               \n"
                              "    -c            Set the clock at the center of the terminal    \n"
                              "    -C [0-7]      Set the clock color                            \n"
                              "    -t            Set the hour in 12h format                     \n"
       @@ -455,6 +478,9 @@ main(int argc, char **argv)
                  case 's':
                       ttyclock->option.second = True;
                       break;
       +          case 'S':
       +               ttyclock->option.screensaver = True;
       +               break;
                  case 'c':
                       ttyclock->option.center = True;
                       break;
   DIR diff --git a/ttyclock.h b/ttyclock.h
       @@ -61,6 +61,7 @@ typedef struct
             struct
             {
                  Bool second;
       +          Bool screensaver;
                  Bool twelve;
                  Bool center;
                  Bool rebound;