all repos — slstatus @ b7d7ce9c5f9ea360955325526e7f8010ae5b1347

my build of slstatus (tools.suckless.org/slstatus/)

slstatus load_avg format string
Kamil CholewiƄski harry666t@gmail.com
Fri, 08 Sep 2017 23:08:28 +0200
commit

b7d7ce9c5f9ea360955325526e7f8010ae5b1347

parent

8f5219b6dab5a1c9b7f92362a34aacfd393fa0e4

2 files changed, 4 insertions(+), 4 deletions(-)

jump to
M config.def.hconfig.def.h

@@ -29,7 +29,7 @@ * ipv4 IPv4 address interface name

* ipv6 IPv6 address interface name * kernel_release `uname -r` NULL * keyboard_indicators caps/num lock indicators NULL - * load_avg load average NULL + * load_avg load average format string * num_files number of files in a directory path * ram_free free memory in GB NULL * ram_perc memory usage in percent NULL
M slstatus.cslstatus.c

@@ -52,7 +52,7 @@ static const char *ipv4(const char *iface);

static const char *ipv6(const char *iface); static const char *kernel_release(void); static const char *keyboard_indicators(void); -static const char *load_avg(void); +static const char *load_avg(const char *fmt); static const char *num_files(const char *dir); static const char *ram_free(void); static const char *ram_perc(void);

@@ -394,7 +394,7 @@ }

} static const char * -load_avg(void) +load_avg(const char *fmt) { double avgs[3];

@@ -403,7 +403,7 @@ warnx("Failed to get the load avg");

return unknown_str; } - return bprintf("%.2f %.2f %.2f", avgs[0], avgs[1], avgs[2]); + return bprintf(fmt, avgs[0], avgs[1], avgs[2]); } static const char *