commit 10408f07ee24d6f4f7a98736aceb320b6160be95
parent d7a8fbd6d38a1cf9ff7d9d92ff0fe022546805b1
Author: bsandro <email@bsandro.tech>
Date: Wed, 19 Jul 2023 22:34:57 +0300
ryzen (main desktop) thingies
Diffstat:
2 files changed, 10 insertions(+), 17 deletions(-)
diff --git a/config.mk b/config.mk
@@ -4,7 +4,7 @@ VERSION = 1.0
# Customize below to fit your system
# paths
-PREFIX = /usr
+PREFIX = /usr/local
MANPREFIX = ${PREFIX}/share/man
X11INC = /usr/X11R6/include
diff --git a/dwmstatus.c b/dwmstatus.c
@@ -226,14 +226,14 @@ char *get_mem()
meminuse = memtotal - memfree;
swapused = swaptotal - swapfree;
- //snprintf(status, 128, "%.0f%%(%dM/%dM) S:%.0f%%(%dM/%dM)",
- snprintf(status, 128, "%.0f%% S:%.0f%%",
+ snprintf(status, 128, "%.0f%%(%dM/%dM) swap:%.0f%%(%dM/%dM)",
+ //snprintf(status, 128, "%.0f%% swap:%.1f%%",
(float)meminuse/memtotal*100,
- //(int)meminuse/1024,
- //(int)memtotal/1024,
- (float)swapused/swaptotal*100);
- //(int)swapused/1024,
- //(int)swaptotal/1024);
+ (int)meminuse/1024,
+ (int)memtotal/1024,
+ (float)swapused/swaptotal*100,
+ (int)swapused/1024,
+ (int)swaptotal/1024);
#ifdef DEBUG
printf("MEM: %.0f%% (%dM/%dM)\n",
@@ -312,28 +312,21 @@ main(void)
{
char *status;
char *avgs;
- char *bat;
char *tmcy;
- char *t1;
if (!(dpy = XOpenDisplay(NULL))) {
fprintf(stderr, "dwmstatus: cannot open display.\n");
return 1;
}
- for (;;sleep(20)) {
+ for (;;sleep(5)) {
avgs = loadavg();
- bat = getbattery("/sys/class/power_supply/BAT0");
tmcy = mktimes("%F %H:%M", tzcyprus);
- t1 = gettemperature("/sys/class/thermal/thermal_zone0/hwmon0", "temp1_input");
- status = smprintf("T:%s M:%s C:%s B:%s | %s",
- t1, get_mem(), get_cpu(), bat, tmcy);
+ status = smprintf("mem:%s cpu:%s time:%s", get_mem(), get_cpu(), tmcy);
setstatus(status);
- free(t1);
free(avgs);
- free(bat);
free(tmcy);
free(status);
}