dotfiles

personal configuration files and scripts
git clone https://tongong.net/git/dotfiles.git
Log | Files | Refs | README

time.c (410B)


      1 #include <stdio.h>
      2 #include <time.h>
      3 
      4 #include "../util.h"
      5 #include "time.h"
      6 
      7 #define ICON " "
      8 
      9 size_t timeu(char *str, int sigval)
     10 {
     11     time_t rawtime;
     12     struct tm *ltime;
     13 
     14     time(&rawtime);
     15     ltime = localtime(&rawtime);
     16 
     17 
     18     return SPRINTF(str, ICON "%02d:%02d:%02d", ltime->tm_hour, ltime->tm_min,
     19                    ltime->tm_sec);
     20 }
     21 
     22 void timec(int button)
     23 {
     24     TERMCMD("tty-clock", "-c");
     25 }