[wiki] [sites] Add dynamic_info.c || Thuban

From: <git_AT_suckless.org>
Date: Sat, 30 Mar 2013 15:54:03 +0100

commit a81aa8b06f3b1b076e592772255303bcc507a8db
Author: Thuban <thuban_AT_singularity.fr>
Date: Sat Mar 30 15:53:56 2013 +0100

    Add dynamic_info.c

diff --git a/dwm.suckless.org/dwmstatus/dynamic_info.c b/dwm.suckless.org/dwmstatus/dynamic_info.c
new file mode 100644
index 0000000..97380f2
--- /dev/null
+++ b/dwm.suckless.org/dwmstatus/dynamic_info.c
_AT_@ -0,0 +1,436 @@
+#define _BSD_SOURCE
+#define _GNU_SOURCE
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <strings.h>
+#include <sys/time.h>
+#include <time.h>
+#include <sys/types.h>
+#include <dirent.h>
+#include <sys/statvfs.h>
+
+
+#include <X11/Xlib.h>
+
+char *tzparis = "Europe/Paris";
+
+static Display *dpy;
+
+char *
+smprintf(char *fmt, ...)
+{
+ va_list fmtargs;
+ char *buf = NULL;
+
+ va_start(fmtargs, fmt);
+ if (vasprintf(&buf, fmt, fmtargs) == -1){
+ fprintf(stderr, "malloc vasprintf
");
+ exit(1);
+ }
+ va_end(fmtargs);
+
+ return buf;
+}
+
+char*
+runcmd(char* cmd) {
+ FILE* fp = popen(cmd, "r");
+ if (fp == NULL) return NULL;
+ char ln[50];
+ fgets(ln, sizeof(ln)-1, fp);
+ pclose(fp);
+ ln[strlen(ln)-1]='
Received on Sat Mar 30 2013 - 15:54:03 CET

This archive was generated by hypermail 2.3.0 : Sat Mar 30 2013 - 16:00:09 CET