From ed80e5df8c718fc2321904db1b81604d1ed33444 Mon Sep 17 00:00:00 2001 From: ben Date: Sat, 3 May 2025 14:59:49 -0700 Subject: suckless --- config/suckless/slstatus/components/hostname.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 config/suckless/slstatus/components/hostname.c (limited to 'config/suckless/slstatus/components/hostname.c') diff --git a/config/suckless/slstatus/components/hostname.c b/config/suckless/slstatus/components/hostname.c new file mode 100644 index 0000000..23da677 --- /dev/null +++ b/config/suckless/slstatus/components/hostname.c @@ -0,0 +1,16 @@ +/* See LICENSE file for copyright and license details. */ +#include +#include + +#include "../util.h" + +const char * +hostname(void) +{ + if (gethostname(buf, sizeof(buf)) < 0) { + warn("gethostbyname:"); + return NULL; + } + + return buf; +} -- cgit v1.2.3