adding battery status
This commit is contained in:
45
config.def.h
45
config.def.h
@ -57,42 +57,19 @@ static const char unknown_str[] = "?";
|
|||||||
* wifi_perc WiFi signal in percent interface name (wlan0)
|
* wifi_perc WiFi signal in percent interface name (wlan0)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define IFACE "enp4s0"
|
#define IFACE "wifibox0"
|
||||||
#define BAT ""
|
#define BAT "BAT1"
|
||||||
|
|
||||||
static const struct arg args[] = {
|
static const struct arg args[] = {
|
||||||
/* function format argument */
|
{ netspeed_rx, " [ %sB/s]", IFACE },
|
||||||
// Network
|
{ ipv4, " ^c#fb4934^[ %s]", IFACE },
|
||||||
{ netspeed_rx, " [ %sB/s]", IFACE },
|
{ battery_perc, " ^c#fe9019^[ %s%%", BAT },
|
||||||
{ ipv4, " ^c#fb4934^[ %s]", IFACE },
|
{ battery_remaining," %s]", BAT },
|
||||||
|
{ run_command, " ^c#8ec07c^[ %s]", "amixer sget Master | awk -F\"[][]\" '/%/ { print $2 }' | head -n1" },
|
||||||
// Battery
|
{ cpu_perc, " ^c#b8bb26^[%s%%]", NULL },
|
||||||
//{ battery_perc, " ^c#fe9019^[ %s%%", BAT },
|
{ ram_used, " ^c#d3869b^[ %s]", NULL },
|
||||||
//{ battery_state, " %s", BAT },
|
{ disk_free, " ^c#fe8019^[ %s]", "/" },
|
||||||
//{ battery_remaining," %s]", BAT
|
{ datetime, " ^c#ebdbb2^[ %s]", "%H:%M:%S" },
|
||||||
// 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" }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
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 |"},
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
@ -7,8 +7,8 @@ VERSION = 1.0
|
|||||||
PREFIX = /usr/local
|
PREFIX = /usr/local
|
||||||
MANPREFIX = $(PREFIX)/share/man
|
MANPREFIX = $(PREFIX)/share/man
|
||||||
|
|
||||||
X11INC = /usr/include
|
X11INC = ${PREFIX}/include
|
||||||
X11LIB = /usr/lib
|
X11LIB = ${PREFIX}/lib
|
||||||
|
|
||||||
# flags
|
# flags
|
||||||
CPPFLAGS = -I$(X11INC) -D_DEFAULT_SOURCE -DVERSION=\"${VERSION}\"
|
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
|
LDFLAGS = -L$(X11LIB) -s
|
||||||
# OpenBSD: add -lsndio
|
# OpenBSD: add -lsndio
|
||||||
# FreeBSD: add -lkvm -lsndio
|
# FreeBSD: add -lkvm -lsndio
|
||||||
LDLIBS = -lX11
|
LDLIBS = -lX11 -lkvm -lsndio
|
||||||
|
|
||||||
# compiler and linker
|
# compiler and linker
|
||||||
CC = cc
|
CC = cc
|
||||||
|
Reference in New Issue
Block a user