mirror of
https://github.com/alrayyes/slstatus-patches
synced 2023-11-14 15:56:31 +00:00
71 lines
1.9 KiB
Diff
71 lines
1.9 KiB
Diff
|
From aa875fe2f41740536dd96e7f1d6ea2c654634102 Mon Sep 17 00:00:00 2001
|
||
|
From: Ryan Kes <alrayyes@gmail.com>
|
||
|
Date: Sat, 30 Mar 2019 13:42:12 +0100
|
||
|
Subject: [PATCH] separator module
|
||
|
|
||
|
---
|
||
|
Makefile | 1 +
|
||
|
components/separator.c | 10 ++++++++++
|
||
|
config.def.h | 1 +
|
||
|
slstatus.h | 3 +++
|
||
|
4 files changed, 15 insertions(+)
|
||
|
create mode 100644 components/separator.c
|
||
|
|
||
|
diff --git a/Makefile b/Makefile
|
||
|
index 945b5e3..2f93b87 100644
|
||
|
--- a/Makefile
|
||
|
+++ b/Makefile
|
||
|
@@ -21,6 +21,7 @@ COM =\
|
||
|
components/num_files\
|
||
|
components/ram\
|
||
|
components/run_command\
|
||
|
+ components/separator\
|
||
|
components/swap\
|
||
|
components/temperature\
|
||
|
components/uptime\
|
||
|
diff --git a/components/separator.c b/components/separator.c
|
||
|
new file mode 100644
|
||
|
index 0000000..40fec52
|
||
|
--- /dev/null
|
||
|
+++ b/components/separator.c
|
||
|
@@ -0,0 +1,10 @@
|
||
|
+/* See LICENSE file for copyright and license details. */
|
||
|
+#include <stdio.h>
|
||
|
+
|
||
|
+#include "../util.h"
|
||
|
+
|
||
|
+const char *
|
||
|
+separator(const char *separator)
|
||
|
+{
|
||
|
+ return separator;
|
||
|
+}
|
||
|
diff --git a/config.def.h b/config.def.h
|
||
|
index e06be66..0895f6a 100644
|
||
|
--- a/config.def.h
|
||
|
+++ b/config.def.h
|
||
|
@@ -45,6 +45,7 @@ static const char unknown_str[] = "n/a";
|
||
|
* ram_total total memory size in GB NULL
|
||
|
* ram_used used memory in GB NULL
|
||
|
* run_command custom shell command command (echo foo)
|
||
|
+ * separator string to echo NULL
|
||
|
* swap_free free swap in GB NULL
|
||
|
* swap_perc swap usage in percent NULL
|
||
|
* swap_total total swap size in GB NULL
|
||
|
diff --git a/slstatus.h b/slstatus.h
|
||
|
index 08f610a..b0f2564 100644
|
||
|
--- a/slstatus.h
|
||
|
+++ b/slstatus.h
|
||
|
@@ -56,6 +56,9 @@ const char *ram_used(void);
|
||
|
/* run_command */
|
||
|
const char *run_command(const char *cmd);
|
||
|
|
||
|
+/* separator */
|
||
|
+const char *separator(const char *separator);
|
||
|
+
|
||
|
/* swap */
|
||
|
const char *swap_free(void);
|
||
|
const char *swap_perc(void);
|
||
|
--
|
||
|
2.21.0
|
||
|
|