s2dblocks

statusbar blocks for dwm
Log | Files | Refs

commit ee9b27abb3b937e83021cd445eaa847839de84f6
parent 525d3b620139ed9b5bf3e22d4c15947c5678d13c
Author: hhvn <dev@hhvn.uk>
Date:   Thu, 14 Apr 2022 17:24:42 +0100

Add time handler

Diffstat:
Ahandlers/time.c | 14++++++++++++++
1 file changed, 14 insertions(+), 0 deletions(-)

diff --git a/handlers/time.c b/handlers/time.c @@ -0,0 +1,14 @@ +#include <stdio.h> +#include <time.h> +#include "../dwmbar.h" + +int +main(void) { + char buf[BUFSIZ]; + time_t t = time(NULL); + + strftime(buf, sizeof(buf), "%H:%M:%S", localtime(&t)); + s2d_print("%s", buf); + s2d_finish(); + return 0; +}