xbattmon

simple battery monitor for X
git clone git://git.2f30.org/xbattmon
Log | Files | Refs | README | LICENSE

commit b7e4d422fa382a49a539bdaa388eb0ddf8d2df3c
parent fe4305206c16d37d7454f29aa9ad2bac9a4ebe85
Author: Quentin Rameau <quinq@fifth.space>
Date:   Mon, 10 Sep 2018 23:01:34 +0200

Warn only about missing first battery Linux

Diffstat:
Mxbattmon.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/xbattmon.c b/xbattmon.c @@ -280,7 +280,9 @@ pollbat(void) snprintf(tmp, sizeof(tmp), PATH_FMT_BAT_FULL, i); fp = fopen(tmp, "r"); if (!fp) { - warn("fopen %s", tmp); + /* warn only if no battery is reachable */ + if (i == 0) + warn("fopen %s", tmp); break; } fscanf(fp, "%d", &full);