Add keybind [0;7] to change color!

reverse-branch
Martin Duquesnoy 17 years ago
parent 695a33a74f
commit c8593cd0a7
  1. 2
      README
  2. 13
      ttyclock.c

@ -1,7 +1,7 @@
tty-clock usage : tty-clock [-option]
-s Show seconds
-c Set the clock at the center of the terminal
-C <num> Set the clock color.
-C <num> Set the clock color
-t Set the hour in 12h format
-r Do rebound the clock
-f <format> Set the date format

@ -316,10 +316,11 @@ set_center(Bool b)
void
key_event(void)
{
int i, c;
halfdelay(1);
switch(getch())
switch((c = getch()))
{
case KEY_UP:
case 'k':
@ -382,6 +383,14 @@ key_event(void)
if(ttyclock->option.rebound && ttyclock->option.center)
ttyclock->option.center = False;
break;
default:
for(i = 0; i < 8; ++i)
if(c == (i + '0'))
{
ttyclock->option.color = i;
init();
}
break;
}
return;
@ -411,7 +420,7 @@ main(int argc, char **argv)
printf("tty-clock usage : tty-clock [-option] \n"
" -s Show seconds \n"
" -c Set the clock at the center of the terminal \n"
" -C <num> Set the clock color. \n"
" -C <num> Set the clock color \n"
" -t Set the hour in 12h format \n"
" -r Do rebound the clock \n"
" -f <format> Set the date format \n"

Loading…
Cancel
Save