- [sahne](https://github.com/sahne)
- [Ali H. Fardan](http://raiz.duckdns.org)
- [Quentin Rameau](https://fifth.space)
+- [Mike Coddington](https://coddington.us)
- Username/GID/UID
- Hostname
- IP addresses
+- Kernel version
- Load averages
- Memory status (free memory, percentage, total memory and used memory)
- Swap status (free swap, percentage, total swap and used swap)
- gid (gid of current user) [argument: NULL]
- hostname [argument: NULL]
- ip (ip address) [argument: interface]
+- kernel_release (uname -r) [argument: NULL]
- load_avg (load average) [argument: NULL]
- ram_free (free ram in GB) [argument: NULL]
- ram_perc (ram usage in percent) [argument: NULL]
#include <sys/socket.h>
#include <sys/sysinfo.h>
#include <sys/types.h>
+#include <sys/utsname.h>
#include <time.h>
#include <unistd.h>
#include <X11/Xlib.h>
static char *vol_perc(const char *card);
static char *wifi_perc(const char *iface);
static char *wifi_essid(const char *iface);
+static char *kernel_release(void);
static void set_status(const char *str);
static void sighandler(const int signo);
static void usage(void);
return smprintf("%s", (char *)wreq.u.essid.pointer);
}
+static char *
+kernel_release(void)
+{
+ struct utsname udata;
+ if (uname(&udata) < 0)
+ return smprintf(UNKNOWN_STR);
+
+ return smprintf("%s", udata.release);
+}
+
static void
set_status(const char *str)
{