Remove unnecessary spaces in statuses

This commit is contained in:
Przemek Grondek 2023-02-17 23:58:11 +01:00
parent d4f3f221cb
commit 18be8fa355

View File

@ -90,7 +90,7 @@ loadavg(void)
if (getloadavg(avgs, 1) < 0) if (getloadavg(avgs, 1) < 0)
return smprintf(""); return smprintf("");
return smprintf("📈 %.2f ", avgs[0]); return smprintf("📈%.2f ", avgs[0]);
} }
char * char *
@ -167,7 +167,7 @@ getbattery(char *base)
if (remcap < 0 || descap < 0) if (remcap < 0 || descap < 0)
return smprintf("invalid"); return smprintf("invalid");
return smprintf("%s %.0f%% ", status, ((float)remcap / (float)descap) * 100); return smprintf("%s%.0f%% ", status, ((float)remcap / (float)descap) * 100);
} }
char * char *
@ -197,7 +197,7 @@ getBrightness(char *base) {
status = ""; status = "";
} }
return smprintf("%s %d%% ", status, percentage); return smprintf("%s%d%% ", status, percentage);
} }
char * char *
getPowerConsumption(char *base) { getPowerConsumption(char *base) {
@ -217,7 +217,7 @@ getPowerConsumption(char *base) {
usage = usageRead/ 1e6; usage = usageRead/ 1e6;
return smprintf("%.2lf W ", usage); return smprintf("%.2lfW ", usage);
} }
char * char *
@ -228,7 +228,7 @@ gettemperature(char *base, char *sensor)
co = readfile(base, sensor); co = readfile(base, sensor);
if (co == NULL) if (co == NULL)
return smprintf(""); return smprintf("");
return smprintf("🌡 %02.0f°C ", atof(co) / 1000); return smprintf("🌡%02.0f°C ", atof(co) / 1000);
} }
void update() { void update() {