From b78932305a00a93042d390e3953507347d1fad01 Mon Sep 17 00:00:00 2001 From: Bradley Taunt Date: Wed, 16 Oct 2024 09:58:36 -0400 Subject: Include laptop and desktop variations, set Firefox as default browser, include desktop screenshot --- desktop/slstatuso/components/cat.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 desktop/slstatuso/components/cat.c (limited to 'desktop/slstatuso/components/cat.c') diff --git a/desktop/slstatuso/components/cat.c b/desktop/slstatuso/components/cat.c new file mode 100755 index 0000000..07944cc --- /dev/null +++ b/desktop/slstatuso/components/cat.c @@ -0,0 +1,32 @@ +/* See LICENSE file for copyright and license details. */ +#include +#include + +#include "../slstatus.h" +#include "../util.h" + +const char * +cat(const char *path) +{ + char *f; + FILE *fp; + + if (!(fp = fopen(path, "r"))) { + warn("fopen '%s':", path); + return NULL; + } + + f = fgets(buf, sizeof(buf) - 1, fp); + if (fclose(fp) < 0) { + warn("fclose '%s':", path); + return NULL; + } + if (!f) + return NULL; + + if ((f = strrchr(buf, '\n'))) + f[0] = '\0'; + + return buf[0] ? buf : NULL; +} + -- cgit v1.2.3-54-g00ecf