added slstatus
This commit is contained in:
1 parent
2eee2f75c0
commit
89e5167279
39 files changed
+3002
-1
No files matched your search
@@ -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);
|
||||
}
|
||||
Reference in new issue
Block a user