From dc645dfd19dc6a2cf8e49d63fd08407bf91d526e Mon Sep 17 00:00:00 2001 From: memL0rz Date: Mon, 23 Sep 2024 21:53:50 +0200 Subject: [PATCH] adding battery status --- config.def.h | 45 +++++++++++---------------------------------- config.mk | 6 +++--- 2 files changed, 14 insertions(+), 37 deletions(-) diff --git a/config.def.h b/config.def.h index ec313d1..d2ca52f 100755 --- a/config.def.h +++ b/config.def.h @@ -57,42 +57,19 @@ static const char unknown_str[] = "?"; * wifi_perc WiFi signal in percent interface name (wlan0) */ -#define IFACE "enp4s0" -#define BAT "" +#define IFACE "wifibox0" +#define BAT "BAT1" static const struct arg args[] = { - /* function format argument */ - // Network - { netspeed_rx, " [ %sB/s]", IFACE }, - { ipv4, " ^c#fb4934^[ %s]", IFACE }, - - // Battery - //{ battery_perc, " ^c#fe9019^[ %s%%", BAT }, - //{ battery_state, " %s", BAT }, - //{ battery_remaining," %s]", BAT - // Brightness, Volume - { run_command, " ^c#8ec07c^[ %s]", "amixer sget Master | awk -F\"[][]\" '/%/ { print $2 }' | head -n1" }, - - // CPU & RAM Usage - { cpu_perc, " ^c#b8bb26^[%s%%]", NULL }, - { ram_used, " ^c#d3869b^[ %s]", NULL }, - { disk_free, " ^c#fe8019^[ %s]", "/" }, - - // Date & time - { datetime, " ^c#ebdbb2^[ %s]", "%H:%M:%S" } + { netspeed_rx, " [ %sB/s]", IFACE }, + { ipv4, " ^c#fb4934^[ %s]", IFACE }, + { battery_perc, " ^c#fe9019^[ %s%%", BAT }, + { battery_remaining," %s]", BAT }, + { run_command, " ^c#8ec07c^[ %s]", "amixer sget Master | awk -F\"[][]\" '/%/ { print $2 }' | head -n1" }, + { cpu_perc, " ^c#b8bb26^[%s%%]", NULL }, + { ram_used, " ^c#d3869b^[ %s]", NULL }, + { disk_free, " ^c#fe8019^[ %s]", "/" }, + { datetime, " ^c#ebdbb2^[ %s]", "%H:%M:%S" }, }; - -/* -static const struct arg args[] = { - { netspeed_tx, "%s", IFACE}, - { ipv4, " | %s", IFACE}, - { ram_used, " | %s", NULL}, - { cpu_perc, " | %s%%", NULL}, - { run_command, " | %s%%", "/bin/sh -c \"amixer get Master | tail -n1 | grep -Po '\\[\\K[^%]*' | head -n1\"" }, - { uptime, " | %s", NULL }, - { datetime, " | %s", "%H:%M:%S |"}, -}; -*/ - diff --git a/config.mk b/config.mk index 7ba4878..00193dc 100755 --- a/config.mk +++ b/config.mk @@ -7,8 +7,8 @@ VERSION = 1.0 PREFIX = /usr/local MANPREFIX = $(PREFIX)/share/man -X11INC = /usr/include -X11LIB = /usr/lib +X11INC = ${PREFIX}/include +X11LIB = ${PREFIX}/lib # flags CPPFLAGS = -I$(X11INC) -D_DEFAULT_SOURCE -DVERSION=\"${VERSION}\" @@ -16,7 +16,7 @@ CFLAGS = -std=c99 -pedantic -Wall -Wextra -Wno-unused-parameter -Os LDFLAGS = -L$(X11LIB) -s # OpenBSD: add -lsndio # FreeBSD: add -lkvm -lsndio -LDLIBS = -lX11 +LDLIBS = -lX11 -lkvm -lsndio # compiler and linker CC = cc