URI:
       Add rebound option - 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 029bf18cfd9e07e0437e1348a77bb04384a731e0
   DIR parent 45f1a9df223732f2298bc6611ef51667abf9a678
  HTML Author: Martin Duquesnoy <xorg62@gmail.com>
       Date:   Tue, 10 Mar 2009 23:05:55 +0100
       
       Add rebound option
       
       Diffstat:
         M README                              |       1 +
         M ttyclock.c                          |      10 +++++++---
         M ttyclock.h                          |       1 +
       
       3 files changed, 9 insertions(+), 3 deletions(-)
       ---
   DIR diff --git a/README b/README
       @@ -2,6 +2,7 @@ tty-clock usage : tty-clock [-option] <arg>
          -s, --second        Show seconds
          -b, --lock          Lock the keyboard
          -t, --twelve        Set the hour in 12h format
       +  -r, --rebound       Do rebound the clock
          -v, --version       Show tty-clock version
          -i, --info          Show some info about tty-clock
          -h, --help          Show this page
   DIR diff --git a/ttyclock.c b/ttyclock.c
       @@ -385,6 +385,8 @@ key_event(void)
             case 'r':
             case 'R':
                  ttyclock->option.rebound = !ttyclock->option.rebound;
       +          if(ttyclock->option.rebound && ttyclock->option.center)
       +               ttyclock->option.center = False;
                  break;
             }
        
       @@ -403,6 +405,7 @@ main(int argc, char **argv)
                       {"info",    0, NULL, 'i'},
                       {"second",  0, NULL, 's'},
                       {"twelve",  0, NULL, 't'},
       +               {"rebound", 0, NULL, 'r'},
                       {"lock",    0, NULL, 'l'},
                       {"center",  0, NULL, 'c'},
                       {NULL,      0, NULL, 0}
       @@ -411,7 +414,7 @@ main(int argc, char **argv)
             /* Alloc ttyclock */
             ttyclock = malloc(sizeof(ttyclock_t));
        
       -     while ((c = getopt_long(argc,argv,"tvslcih",
       +     while ((c = getopt_long(argc,argv,"tvslrcih",
                                     long_options, NULL)) != -1)
             {
                  switch(c)
       @@ -441,6 +444,9 @@ main(int argc, char **argv)
                  case 't':
                       ttyclock->option.twelve = True;
                       break;
       +          case 'r':
       +               ttyclock->option.rebound = True;
       +               break;
                  case 'l':
                       ttyclock->option.keylock = True;
                       break;
       @@ -449,13 +455,11 @@ main(int argc, char **argv)
        
             init();
        
       -
             while(ttyclock->running)
             {
                  clock_rebound();
                  update_hour();
                  draw_clock();
       -
                  key_event();
                  usleep(UPDATETIME);
             }
   DIR diff --git a/ttyclock.h b/ttyclock.h
       @@ -55,6 +55,7 @@
           -l, --lock       Lock the keyboard                           \n\
           -c, --center     Set the clock at the center of the terminal \n\
           -t, --twelve     Set the hour in 12h format                  \n\
       +   -r, --rebound    Do rebound the clock                        \n\
           -v, --version    Show tty-clock version                      \n\
           -i, --info       Show some info about tty-clock              \n\
           -h, --help       Show this page                              "