mirror of
https://github.com/alrayyes/slstatus
synced 2023-11-14 15:56:27 +00:00
added seperator patch
This commit is contained in:
parent
9c2932f85c
commit
68e5b68d3c
24
PKGBUILD
24
PKGBUILD
@ -6,21 +6,37 @@ pkgrel=1
|
|||||||
pkgdesc='A status monitor for window managers'
|
pkgdesc='A status monitor for window managers'
|
||||||
arch=('i686' 'x86_64')
|
arch=('i686' 'x86_64')
|
||||||
url='http://tools.suckless.org/slstatus'
|
url='http://tools.suckless.org/slstatus'
|
||||||
depends=('libx11')
|
depends=('libx11' 'alsa-utils' 'xorg-xbacklight')
|
||||||
makedepends=('git')
|
makedepends=('git')
|
||||||
license=('custom:ISC')
|
license=('custom:ISC')
|
||||||
|
|
||||||
|
_patches=(
|
||||||
|
"seperator-20180305-f4e35fa.diff"
|
||||||
|
)
|
||||||
|
|
||||||
source=("git+https://git.suckless.org/${pkgname%-git}"
|
source=("git+https://git.suckless.org/${pkgname%-git}"
|
||||||
"config.h")
|
"config.h"
|
||||||
|
"${_patches[@]}")
|
||||||
|
|
||||||
md5sums=('SKIP'
|
md5sums=('SKIP'
|
||||||
'ce9e0a0861335b6fbc4ff039bef0c9d5')
|
'b928045f39e259a1fa526e18b1ce8dc1'
|
||||||
|
'24ea93ef665decc0315248f62aa65f44')
|
||||||
|
|
||||||
pkgver() {
|
pkgver() {
|
||||||
cd "${pkgname%-git}"
|
cd "${pkgname%-git}"
|
||||||
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
|
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
prepare() {
|
prepare() {
|
||||||
cp config.h "${pkgname%-git}/config.h"
|
cd "${pkgname%-git}"
|
||||||
|
|
||||||
|
for patch in "${_patches[@]}"; do
|
||||||
|
echo "Applying patch $(basename $patch)..."
|
||||||
|
patch -Np1 -i "$srcdir/$(basename $patch)"
|
||||||
|
done
|
||||||
|
|
||||||
|
cp $srcdir/config.h config.h
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
|
34
config.h
34
config.h
@ -61,10 +61,32 @@ static const char unknown_str[] = "n/a";
|
|||||||
*/
|
*/
|
||||||
static const struct arg args[] = {
|
static const struct arg args[] = {
|
||||||
/* function format argument */
|
/* function format argument */
|
||||||
{ ram_perc, "%s", NULL },
|
/* { seperator, "\x05", NULL }, */
|
||||||
{ cpu_perc, "<\x03 %2s%%", NULL },
|
{ wifi_essid, "\x06 %s", "wlp4s0" },
|
||||||
{ cpu_freq, "|\x03%4sHz", NULL },
|
{ wifi_perc, " %s%% ", "wlp4s0" },
|
||||||
{ vol_perc, " %s%%\x04>", "/dev/mixer" },
|
{ seperator, "\x07", NULL },
|
||||||
{ temp, "%s", "/sys/class/thermal/thermal_zone0/temp" },
|
{ ipv4, "\x08 %s ", "wlp4s0" },
|
||||||
{ datetime, "%s", "%d-%m-%Y %T" },
|
{ seperator, "\x09", NULL },
|
||||||
|
{ netspeed_rx, "\x0A %s", "wlp4s0" },
|
||||||
|
{ netspeed_tx, " %s ", "wlp4s0" },
|
||||||
|
{ seperator, "\x0B", NULL },
|
||||||
|
{ battery_perc, "\x0C %s%%", "BAT0" },
|
||||||
|
{ battery_remaining, " %s ", "BAT0" },
|
||||||
|
{ seperator, "\x0D", NULL },
|
||||||
|
/* { run_command, "\x0E %s%% ", "/bin/sh -c \"xbacklight -get | xargs printf '%.*f\n' 0 \"" }, */
|
||||||
|
/* { seperator, "\x0F", NULL }, */
|
||||||
|
{ disk_perc, "\x10 / %s%%", "/" },
|
||||||
|
{ disk_perc, " %s%% ", "/home" },
|
||||||
|
{ seperator, "\x11", NULL },
|
||||||
|
/* { run_command, "\x12 蓼 %s%% ", "/bin/sh -c \"amixer get Master | tail -n1 | grep -Po '\\[\\K[^%]*' | head -n1\"" }, */
|
||||||
|
/* { seperator, "\x13", NULL }, */
|
||||||
|
{ ram_perc, "\x14 %s%% ", NULL },
|
||||||
|
{ seperator, "\x15", NULL },
|
||||||
|
{ load_avg, "\x16 %s ", NULL },
|
||||||
|
{ seperator, "\x17", NULL },
|
||||||
|
{ cpu_perc, "\x18 %s%% ", NULL },
|
||||||
|
{ seperator, "\x19", NULL },
|
||||||
|
{ temp, "\x1A %s糖 ", "/sys/class/thermal/thermal_zone0/temp" },
|
||||||
|
{ seperator, "\x1B", NULL },
|
||||||
|
{ datetime, "\x1C 﨟 %s", "%d-%m-%Y %T" },
|
||||||
};
|
};
|
||||||
|
70
seperator-20180305-f4e35fa.diff
Normal file
70
seperator-20180305-f4e35fa.diff
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
From f4e35fa506f3df8942fa209b40a08188798d6fb2 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Ryan Kes <alrayyes@gmail.com>
|
||||||
|
Date: Tue, 5 Mar 2019 21:04:59 +0100
|
||||||
|
Subject: [PATCH] added seperator
|
||||||
|
|
||||||
|
---
|
||||||
|
Makefile | 1 +
|
||||||
|
components/seperator.c | 10 ++++++++++
|
||||||
|
config.def.h | 1 +
|
||||||
|
slstatus.h | 3 +++
|
||||||
|
4 files changed, 15 insertions(+)
|
||||||
|
create mode 100644 components/seperator.c
|
||||||
|
|
||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index 945b5e3..20796b3 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -21,6 +21,7 @@ COM =\
|
||||||
|
components/num_files\
|
||||||
|
components/ram\
|
||||||
|
components/run_command\
|
||||||
|
+ components/seperator\
|
||||||
|
components/swap\
|
||||||
|
components/temperature\
|
||||||
|
components/uptime\
|
||||||
|
diff --git a/components/seperator.c b/components/seperator.c
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..826a461
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/components/seperator.c
|
||||||
|
@@ -0,0 +1,10 @@
|
||||||
|
+/* See LICENSE file for copyright and license details. */
|
||||||
|
+#include <stdio.h>
|
||||||
|
+
|
||||||
|
+#include "../util.h"
|
||||||
|
+
|
||||||
|
+const char *
|
||||||
|
+seperator(char *seperator)
|
||||||
|
+{
|
||||||
|
+ return seperator;
|
||||||
|
+}
|
||||||
|
diff --git a/config.def.h b/config.def.h
|
||||||
|
index e06be66..af289e5 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)
|
||||||
|
+ * seperator 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..78aef21 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);
|
||||||
|
|
||||||
|
+/* seperator */
|
||||||
|
+const char *seperator(const char *seperator);
|
||||||
|
+
|
||||||
|
/* swap */
|
||||||
|
const char *swap_free(void);
|
||||||
|
const char *swap_perc(void);
|
||||||
|
--
|
||||||
|
2.21.0
|
||||||
|
|
Loading…
Reference in New Issue
Block a user