i3status: Bump to 2.14

This commit is contained in:
Tee KOBAYASHI 2022-11-23 15:08:29 +09:00 committed by xtkoba
parent bac8671ce0
commit a2708ee26d
10 changed files with 210 additions and 245 deletions

View File

@ -2,13 +2,12 @@ TERMUX_PKG_HOMEPAGE=https://i3wm.org/i3status/
TERMUX_PKG_DESCRIPTION="Generates status bar to use with i3bar"
TERMUX_PKG_LICENSE="BSD 3-Clause"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=2.13
TERMUX_PKG_REVISION=26
TERMUX_PKG_SRCURL=https://i3wm.org/i3status/i3status-${TERMUX_PKG_VERSION}.tar.bz2
TERMUX_PKG_SHA256=ce89c9ff8565f62e88299f1a611229afdfc356b4e97368a5f8c4f06ad2fa1466
TERMUX_PKG_VERSION=2.14
TERMUX_PKG_SRCURL=https://i3wm.org/i3status/i3status-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=5c4d0273410f9fa3301fd32065deda32e9617fcae8b3cb34793061bf21644924
TERMUX_PKG_DEPENDS="libandroid-glob, libconfuse, libnl, pulseaudio, yajl"
TERMUX_PKG_CONFFILES="etc/i3status.conf"
termux_step_pre_configure() {
autoreconf -fi
LDFLAGS+=" -landroid-glob"
}

View File

@ -1,6 +1,6 @@
diff -uNr i3status-2.13/i3status.conf i3status-2.13.mod/i3status.conf
--- i3status-2.13/i3status.conf 2019-02-09 18:13:25.000000000 +0200
+++ i3status-2.13.mod/i3status.conf 2019-07-19 02:04:01.159446241 +0300
--- i3status-2.13/etc/i3status.conf 2019-02-09 18:13:25.000000000 +0200
+++ i3status-2.13.mod/etc/i3status.conf 2019-07-19 02:04:01.159446241 +0300
@@ -11,37 +11,13 @@
interval = 5
}

View File

@ -1,40 +0,0 @@
diff -uNr i3status-2.13/Makefile.am i3status-2.13.mod/Makefile.am
--- i3status-2.13/Makefile.am 2019-02-21 16:35:12.000000000 +0200
+++ i3status-2.13.mod/Makefile.am 2019-07-19 02:20:40.232423055 +0300
@@ -29,7 +29,6 @@
$(YAJL_CFLAGS) \
$(PULSE_CFLAGS) \
$(NLGENL_CFLAGS) \
- $(ALSA_CFLAGS) \
$(PTHREAD_CFLAGS)
i3status_CPPFLAGS = \
@@ -41,7 +40,6 @@
$(YAJL_LIBS) \
$(PULSE_LIBS) \
$(NLGENL_LIBS) \
- $(ALSA_LIBS) \
$(PTHREAD_LIBS)
i3status_SOURCES = \
@@ -52,20 +50,16 @@
src/first_network_device.c \
src/general.c \
src/output.c \
- src/print_battery_info.c \
src/print_cpu_temperature.c \
src/print_cpu_usage.c \
src/print_ddate.c \
src/print_disk_info.c \
- src/print_eth_info.c \
src/print_ip_addr.c \
src/print_ipv6_addr.c \
- src/print_load.c \
src/print_mem.c \
src/print_path_exists.c \
src/print_run_watch.c \
src/print_time.c \
- src/print_volume.c \
src/print_wireless_info.c \
src/print_file_contents.c \
src/process_runs.c \

View File

@ -1,20 +0,0 @@
diff -uNr i3status-2.13/configure.ac i3status-2.13.mod/configure.ac
--- i3status-2.13/configure.ac 2019-06-30 20:53:24.000000000 +0300
+++ i3status-2.13.mod/configure.ac 2019-07-19 02:18:04.275231603 +0300
@@ -73,7 +73,7 @@
AC_SEARCH_LIBS([floor], [m], , [AC_MSG_FAILURE([cannot find the required floor() function despite trying to link with -lm])])
-AC_SEARCH_LIBS([shm_open], [rt])
+AC_SEARCH_LIBS([glob], [android-glob])
AC_CANONICAL_HOST
@@ -83,7 +83,6 @@
case $host_os in
linux*)
PKG_CHECK_MODULES([NLGENL], [libnl-genl-3.0])
- PKG_CHECK_MODULES([ALSA], [alsa])
PKG_CHECK_MODULES([PULSE], [libpulse])
;;
netbsd*)

View File

@ -1,156 +0,0 @@
diff -uNr i3status-2.13/i3status.c i3status-2.13.mod/i3status.c
--- i3status-2.13/i3status.c 2019-02-21 16:35:12.000000000 +0200
+++ i3status-2.13.mod/i3status.c 2019-07-19 02:34:38.188689039 +0300
@@ -346,16 +346,6 @@
CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT,
CFG_END()};
- cfg_opt_t ethernet_opts[] = {
- CFG_STR("format_up", "E: %ip (%speed)", CFGF_NONE),
- CFG_STR("format_down", "E: down", CFGF_NONE),
- CFG_CUSTOM_ALIGN_OPT,
- CFG_CUSTOM_COLOR_OPTS,
- CFG_CUSTOM_MIN_WIDTH_OPT,
- CFG_CUSTOM_SEPARATOR_OPT,
- CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT,
- CFG_END()};
-
cfg_opt_t ipv6_opts[] = {
CFG_STR("format_up", "%ip", CFGF_NONE),
CFG_STR("format_down", "no IPv6", CFGF_NONE),
@@ -366,26 +356,6 @@
CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT,
CFG_END()};
- cfg_opt_t battery_opts[] = {
- CFG_STR("format", "%status %percentage %remaining", CFGF_NONE),
- CFG_STR("format_down", "No battery", CFGF_NONE),
- CFG_STR("status_chr", "CHR", CFGF_NONE),
- CFG_STR("status_bat", "BAT", CFGF_NONE),
- CFG_STR("status_unk", "UNK", CFGF_NONE),
- CFG_STR("status_full", "FULL", CFGF_NONE),
- CFG_STR("path", "/sys/class/power_supply/BAT%d/uevent", CFGF_NONE),
- CFG_INT("low_threshold", 30, CFGF_NONE),
- CFG_STR("threshold_type", "time", CFGF_NONE),
- CFG_BOOL("last_full_capacity", false, CFGF_NONE),
- CFG_BOOL("integer_battery_capacity", false, CFGF_NONE),
- CFG_BOOL("hide_seconds", true, CFGF_NONE),
- CFG_CUSTOM_ALIGN_OPT,
- CFG_CUSTOM_COLOR_OPTS,
- CFG_CUSTOM_MIN_WIDTH_OPT,
- CFG_CUSTOM_SEPARATOR_OPT,
- CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT,
- CFG_END()};
-
cfg_opt_t time_opts[] = {
CFG_STR("format", "%Y-%m-%d %H:%M:%S", CFGF_NONE),
CFG_CUSTOM_ALIGN_OPT,
@@ -414,17 +384,6 @@
CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT,
CFG_END()};
- cfg_opt_t load_opts[] = {
- CFG_STR("format", "%1min %5min %15min", CFGF_NONE),
- CFG_STR("format_above_threshold", NULL, CFGF_NONE),
- CFG_FLOAT("max_threshold", 5, CFGF_NONE),
- CFG_CUSTOM_ALIGN_OPT,
- CFG_CUSTOM_COLOR_OPTS,
- CFG_CUSTOM_MIN_WIDTH_OPT,
- CFG_CUSTOM_SEPARATOR_OPT,
- CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT,
- CFG_END()};
-
cfg_opt_t memory_opts[] = {
CFG_STR("format", "%used %free %available", CFGF_NONE),
CFG_STR("format_degraded", NULL, CFGF_NONE),
@@ -478,19 +437,6 @@
CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT,
CFG_END()};
- cfg_opt_t volume_opts[] = {
- CFG_STR("format", "♪: %volume", CFGF_NONE),
- CFG_STR("format_muted", "♪: 0%%", CFGF_NONE),
- CFG_STR("device", "default", CFGF_NONE),
- CFG_STR("mixer", "Master", CFGF_NONE),
- CFG_INT("mixer_idx", 0, CFGF_NONE),
- CFG_CUSTOM_ALIGN_OPT,
- CFG_CUSTOM_COLOR_OPTS,
- CFG_CUSTOM_MIN_WIDTH_OPT,
- CFG_CUSTOM_SEPARATOR_OPT,
- CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT,
- CFG_END()};
-
cfg_opt_t read_opts[] = {
CFG_STR("format", "%content", CFGF_NONE),
CFG_STR("format_bad", "%title - %errno: %error", CFGF_NONE),
@@ -509,16 +455,12 @@
CFG_SEC("run_watch", run_watch_opts, CFGF_TITLE | CFGF_MULTI),
CFG_SEC("path_exists", path_exists_opts, CFGF_TITLE | CFGF_MULTI),
CFG_SEC("wireless", wireless_opts, CFGF_TITLE | CFGF_MULTI),
- CFG_SEC("ethernet", ethernet_opts, CFGF_TITLE | CFGF_MULTI),
- CFG_SEC("battery", battery_opts, CFGF_TITLE | CFGF_MULTI),
CFG_SEC("cpu_temperature", temp_opts, CFGF_TITLE | CFGF_MULTI),
CFG_SEC("disk", disk_opts, CFGF_TITLE | CFGF_MULTI),
- CFG_SEC("volume", volume_opts, CFGF_TITLE | CFGF_MULTI),
CFG_SEC("ipv6", ipv6_opts, CFGF_NONE),
CFG_SEC("time", time_opts, CFGF_NONE),
CFG_SEC("tztime", tztime_opts, CFGF_TITLE | CFGF_MULTI),
CFG_SEC("ddate", ddate_opts, CFGF_NONE),
- CFG_SEC("load", load_opts, CFGF_NONE),
CFG_SEC("memory", memory_opts, CFGF_NONE),
CFG_SEC("cpu_usage", usage_opts, CFGF_NONE),
CFG_SEC("read_file", read_opts, CFGF_TITLE | CFGF_MULTI),
@@ -714,23 +656,6 @@
SEC_CLOSE_MAP;
}
- CASE_SEC_TITLE("ethernet") {
- SEC_OPEN_MAP("ethernet");
- const char *interface = NULL;
- if (strcasecmp(title, "_first_") == 0)
- interface = first_eth_interface(NET_TYPE_ETHERNET);
- if (interface == NULL)
- interface = title;
- print_eth_info(json_gen, buffer, interface, cfg_getstr(sec, "format_up"), cfg_getstr(sec, "format_down"));
- SEC_CLOSE_MAP;
- }
-
- CASE_SEC_TITLE("battery") {
- SEC_OPEN_MAP("battery");
- print_battery_info(json_gen, buffer, (strcasecmp(title, "all") == 0 ? -1 : atoi(title)), cfg_getstr(sec, "path"), cfg_getstr(sec, "format"), cfg_getstr(sec, "format_down"), cfg_getstr(sec, "status_chr"), cfg_getstr(sec, "status_bat"), cfg_getstr(sec, "status_unk"), cfg_getstr(sec, "status_full"), cfg_getint(sec, "low_threshold"), cfg_getstr(sec, "threshold_type"), cfg_getbool(sec, "last_full_capacity"), cfg_getbool(sec, "integer_battery_capacity"), cfg_getbool(sec, "hide_seconds"));
- SEC_CLOSE_MAP;
- }
-
CASE_SEC_TITLE("run_watch") {
SEC_OPEN_MAP("run_watch");
print_run_watch(json_gen, buffer, title, cfg_getstr(sec, "pidfile"), cfg_getstr(sec, "format"), cfg_getstr(sec, "format_down"));
@@ -749,12 +674,6 @@
SEC_CLOSE_MAP;
}
- CASE_SEC("load") {
- SEC_OPEN_MAP("load");
- print_load(json_gen, buffer, cfg_getstr(sec, "format"), cfg_getstr(sec, "format_above_threshold"), cfg_getfloat(sec, "max_threshold"));
- SEC_CLOSE_MAP;
- }
-
CASE_SEC("memory") {
SEC_OPEN_MAP("memory");
print_memory(json_gen, buffer, cfg_getstr(sec, "format"), cfg_getstr(sec, "format_degraded"), cfg_getstr(sec, "threshold_degraded"), cfg_getstr(sec, "threshold_critical"), cfg_getstr(sec, "memory_used_method"));
@@ -779,16 +698,6 @@
SEC_CLOSE_MAP;
}
- CASE_SEC_TITLE("volume") {
- SEC_OPEN_MAP("volume");
- print_volume(json_gen, buffer, cfg_getstr(sec, "format"),
- cfg_getstr(sec, "format_muted"),
- cfg_getstr(sec, "device"),
- cfg_getstr(sec, "mixer"),
- cfg_getint(sec, "mixer_idx"));
- SEC_CLOSE_MAP;
- }
-
CASE_SEC_TITLE("cpu_temperature") {
SEC_OPEN_MAP("cpu_temperature");
print_cpu_temperature_info(json_gen, buffer, atoi(title), cfg_getstr(sec, "path"), cfg_getstr(sec, "format"), cfg_getstr(sec, "format_above_threshold"), cfg_getint(sec, "max_threshold"));

View File

@ -1,22 +0,0 @@
diff -uNr i3status-2.13/include/i3status.h i3status-2.13.mod/include/i3status.h
--- i3status-2.13/include/i3status.h 2019-02-21 16:35:12.000000000 +0200
+++ i3status-2.13.mod/include/i3status.h 2019-07-19 02:34:05.475239331 +0300
@@ -214,7 +214,6 @@
void print_ipv6_info(yajl_gen json_gen, char *buffer, const char *format_up, const char *format_down);
void print_disk_info(yajl_gen json_gen, char *buffer, const char *path, const char *format, const char *format_below_threshold, const char *format_not_mounted, const char *prefix_type, const char *threshold_type, const double low_threshold);
-void print_battery_info(yajl_gen json_gen, char *buffer, int number, const char *path, const char *format, const char *format_down, const char *status_chr, const char *status_bat, const char *status_unk, const char *status_full, int low_threshold, char *threshold_type, bool last_full_capacity, bool integer_battery_capacity, bool hide_seconds);
void print_time(yajl_gen json_gen, char *buffer, const char *title, const char *format, const char *tz, const char *locale, const char *format_time, bool hide_if_equals_localtime, time_t t);
void print_ddate(yajl_gen json_gen, char *buffer, const char *format, time_t t);
const char *get_ip_addr(const char *interface, int family);
@@ -223,10 +222,7 @@
void print_path_exists(yajl_gen json_gen, char *buffer, const char *title, const char *path, const char *format, const char *format_down);
void print_cpu_temperature_info(yajl_gen json_gen, char *buffer, int zone, const char *path, const char *format, const char *format_above_threshold, int);
void print_cpu_usage(yajl_gen json_gen, char *buffer, const char *format, const char *format_above_threshold, const char *format_above_degraded_threshold, const char *path, const float max_threshold, const float degraded_threshold);
-void print_eth_info(yajl_gen json_gen, char *buffer, const char *interface, const char *format_up, const char *format_down);
-void print_load(yajl_gen json_gen, char *buffer, const char *format, const char *format_above_threshold, const float max_threshold);
void print_memory(yajl_gen json_gen, char *buffer, const char *format, const char *format_degraded, const char *threshold_degraded, const char *threshold_critical, const char *memory_used_method);
-void print_volume(yajl_gen json_gen, char *buffer, const char *fmt, const char *fmt_muted, const char *device, const char *mixer, int mixer_idx);
bool process_runs(const char *path);
int volume_pulseaudio(uint32_t sink_idx, const char *sink_name);
bool description_pulseaudio(uint32_t sink_idx, const char *sink_name, char buffer[MAX_SINK_DESCRIPTION_LEN]);

View File

@ -0,0 +1,131 @@
--- a/i3status.c
+++ b/i3status.c
@@ -294,6 +294,7 @@
CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT,
CFG_END()};
+#if 0
cfg_opt_t ethernet_opts[] = {
CFG_STR("format_up", "E: %ip (%speed)", CFGF_NONE),
CFG_STR("format_down", "E: down", CFGF_NONE),
@@ -303,6 +304,7 @@
CFG_CUSTOM_SEPARATOR_OPT,
CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT,
CFG_END()};
+#endif
cfg_opt_t ipv6_opts[] = {
CFG_STR("format_up", "%ip", CFGF_NONE),
@@ -314,6 +316,7 @@
CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT,
CFG_END()};
+#if 0
cfg_opt_t battery_opts[] = {
CFG_STR("format", "%status %percentage %remaining", CFGF_NONE),
CFG_STR("format_down", "No battery", CFGF_NONE),
@@ -334,6 +337,7 @@
CFG_CUSTOM_SEPARATOR_OPT,
CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT,
CFG_END()};
+#endif
cfg_opt_t time_opts[] = {
CFG_STR("format", "%Y-%m-%d %H:%M:%S", CFGF_NONE),
@@ -363,6 +367,7 @@
CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT,
CFG_END()};
+#if 0
cfg_opt_t load_opts[] = {
CFG_STR("format", "%1min %5min %15min", CFGF_NONE),
CFG_STR("format_above_threshold", NULL, CFGF_NONE),
@@ -373,6 +378,7 @@
CFG_CUSTOM_SEPARATOR_OPT,
CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT,
CFG_END()};
+#endif
cfg_opt_t memory_opts[] = {
CFG_STR("format", "%used %free %available", CFGF_NONE),
@@ -429,6 +435,7 @@
CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT,
CFG_END()};
+#if 0
cfg_opt_t volume_opts[] = {
CFG_STR("format", "♪: %volume", CFGF_NONE),
CFG_STR("format_muted", "♪: 0%%", CFGF_NONE),
@@ -441,6 +448,7 @@
CFG_CUSTOM_SEPARATOR_OPT,
CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT,
CFG_END()};
+#endif
cfg_opt_t read_opts[] = {
CFG_STR("format", "%content", CFGF_NONE),
@@ -460,16 +468,12 @@
CFG_SEC("run_watch", run_watch_opts, CFGF_TITLE | CFGF_MULTI),
CFG_SEC("path_exists", path_exists_opts, CFGF_TITLE | CFGF_MULTI),
CFG_SEC("wireless", wireless_opts, CFGF_TITLE | CFGF_MULTI),
- CFG_SEC("ethernet", ethernet_opts, CFGF_TITLE | CFGF_MULTI),
- CFG_SEC("battery", battery_opts, CFGF_TITLE | CFGF_MULTI),
CFG_SEC("cpu_temperature", temp_opts, CFGF_TITLE | CFGF_MULTI),
CFG_SEC("disk", disk_opts, CFGF_TITLE | CFGF_MULTI),
- CFG_SEC("volume", volume_opts, CFGF_TITLE | CFGF_MULTI),
CFG_SEC("ipv6", ipv6_opts, CFGF_NONE),
CFG_SEC("time", time_opts, CFGF_NONE),
CFG_SEC("tztime", tztime_opts, CFGF_TITLE | CFGF_MULTI),
CFG_SEC("ddate", ddate_opts, CFGF_NONE),
- CFG_SEC("load", load_opts, CFGF_NONE),
CFG_SEC("memory", memory_opts, CFGF_NONE),
CFG_SEC("cpu_usage", usage_opts, CFGF_NONE),
CFG_SEC("read_file", read_opts, CFGF_TITLE | CFGF_MULTI),
@@ -709,6 +713,7 @@
SEC_CLOSE_MAP;
}
+#if 0
CASE_SEC_TITLE("ethernet") {
SEC_OPEN_MAP("ethernet");
const char *interface = NULL;
@@ -751,6 +756,7 @@
print_battery_info(&ctx);
SEC_CLOSE_MAP;
}
+#endif
CASE_SEC_TITLE("run_watch") {
SEC_OPEN_MAP("run_watch");
@@ -800,6 +806,7 @@
SEC_CLOSE_MAP;
}
+#if 0
CASE_SEC("load") {
SEC_OPEN_MAP("load");
load_ctx_t ctx = {
@@ -813,6 +820,7 @@
print_load(&ctx);
SEC_CLOSE_MAP;
}
+#endif
CASE_SEC("memory") {
SEC_OPEN_MAP("memory");
@@ -881,6 +889,7 @@
SEC_CLOSE_MAP;
}
+#if 0
CASE_SEC_TITLE("volume") {
SEC_OPEN_MAP("volume");
volume_ctx_t ctx = {
@@ -896,6 +905,7 @@
print_volume(&ctx);
SEC_CLOSE_MAP;
}
+#endif
CASE_SEC_TITLE("cpu_temperature") {
SEC_OPEN_MAP("cpu_temperature");

View File

@ -0,0 +1,34 @@
--- a/include/i3status.h
+++ b/include/i3status.h
@@ -278,7 +278,6 @@
bool hide_seconds;
} battery_info_ctx_t;
-void print_battery_info(battery_info_ctx_t *ctx);
typedef struct {
yajl_gen json_gen;
@@ -382,7 +381,6 @@
const char *format_down;
} eth_info_ctx_t;
-void print_eth_info(eth_info_ctx_t *ctx);
typedef struct {
yajl_gen json_gen;
@@ -393,7 +391,6 @@
const float max_threshold;
} load_ctx_t;
-void print_load(load_ctx_t *ctx);
typedef struct {
yajl_gen json_gen;
@@ -421,7 +418,6 @@
int mixer_idx;
} volume_ctx_t;
-void print_volume(volume_ctx_t *ctx);
bool process_runs(const char *path);
int volume_pulseaudio(uint32_t sink_idx, const char *sink_name);

View File

@ -0,0 +1,39 @@
--- a/meson.build
+++ b/meson.build
@@ -155,20 +155,16 @@
'src/format_placeholders.c',
'src/general.c',
'src/output.c',
- 'src/print_battery_info.c',
'src/print_cpu_temperature.c',
'src/print_cpu_usage.c',
'src/print_ddate.c',
'src/print_disk_info.c',
- 'src/print_eth_info.c',
'src/print_ip_addr.c',
'src/print_ipv6_addr.c',
- 'src/print_load.c',
'src/print_mem.c',
'src/print_path_exists.c',
'src/print_run_watch.c',
'src/print_time.c',
- 'src/print_volume.c',
'src/print_wireless_info.c',
'src/print_file_contents.c',
'src/process_runs.c',
@@ -192,10 +188,13 @@
endif
host_os = host_machine.system()
-if host_os == 'linux'
+if host_os == 'linux' or host_os == 'android'
nlgenl_dep = dependency('libnl-genl-3.0', method: 'pkg-config')
+ i3status_deps += [nlgenl_dep]
+endif
+if host_os == 'linux'
alsa_dep = dependency('alsa', method: 'pkg-config')
- i3status_deps += [nlgenl_dep, alsa_dep]
+ i3status_deps += [alsa_dep]
endif
if host_os == 'netbsd'
prop_dep = cc.find_library('prop')