removed slstatus and just built it into dwm instead as it is really simple

This commit is contained in:
DarthMooMancer
2025-09-08 21:14:05 -04:00
parent d76cd57d48
commit deb4877c81
13 changed files with 33 additions and 2146 deletions
+26
View File
@@ -0,0 +1,26 @@
#include "bar.h"
#include <stdio.h>
const char* vol() {
static char buf[5];
float v;
FILE *fp = popen("wpctl get-volume @DEFAULT_AUDIO_SINK@", "r");
if (!fp || fscanf(fp, "Volume: %f", &v) != 1) return NULL;
pclose(fp);
snprintf(buf, sizeof(buf), "%d%%", (int)(v * 100));
return buf;
}
const char* age() {
static char buf[5];
int days;
FILE *fp = popen("sh -c 'echo $(( ( $(date +%s) - $(stat -c %W /) ) / 86400 ))'", "r");
if (!fp || fscanf(fp, "%d", &days) != 1) return NULL;
pclose(fp);
snprintf(buf, sizeof(buf), "%dd", days);
return buf;
}
void execute_bar(char *out, size_t len) {
snprintf(out, len, "V: %s A: %s", vol(), age());
}