added slstatus

This commit is contained in:
wt committed 2024-11-06 00:35:34 +07:00
1 parent 2eee2f75c0
commit 89e5167279
39 files changed
+3002 -1

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
#include <stdio.h>
#include <string.h>
#include "../slstatus.h"
#include "../util.h"
#define WTTR_TEMP "/tmp/wttr"
const char *weather()
{
FILE *wttr = fopen(WTTR_TEMP, "r");
char temp[10];
memset(&temp, '\0', 10);
fgets(temp, 10, wttr);
fclose(wttr);
temp[strlen(temp)-1] = '\0';
return bprintf("%s", temp);
}