Closed bad-interpreter closed 6 years ago
I solved: the variable ${apcupsd_status} has a trailing space, so it must be compared with "ONLINE " and "ONBATT ".
What happens when you change the following line:
to
FILL("STATUS", APCUPSD_STATUS, TRUE);
git clone https://github.com/brndnmtthws/conky
cd conky
mkdir -p build
cd build
cmake ..
make -j4 # 4 cores to run in parallel
src/conky -c ~/conky.conf # <-- your config goes here
Don't forget to change the above line with TRUE.
Works as expected! No trailing space anymore!
@su8 Mind pushing a fix on new branch to this repository?
@lasers You go ahead and open a PR with this fix :heart:
@su8 What do I describe this? I see it's defined on line 136 saying... FIRST?
EDIT: More accurate to use remove trailing whitespace
or remove trailing newline
?
EDIT: What does if (FIRST)
does? I see it check for a space, but the second one?
What does if (FIRST) does? I see it check for a space, but the second one?
It stops on first encountered space character and terminates with '\0' or 0.
More accurate to use remove trailing whitespace or remove trailing newline ?
remove trailing whitespace should be fine.
Closed via https://github.com/brndnmtthws/conky/issues/593. Thank you for the report. Keep them coming.
My $apcupsd_status variable is "ONLINE". But if I do
${if_match "${apcupsd_status}" != "ONLINE"}NOT ONLINE${endif}
it will print "NOT ONLINE" too, in the same config. Is it a bug?
conky 1.10.8_pre compiled lun 16 lug 2018, 13.24.10, CEST for Linux 4.14.55-zion x86_64
Compiled in features:
System config file: /etc/conky/conky.conf Package library path: /usr/lib64/conky
General:
Internationalization support
Lua bindings:
Own window
Music detection:
MOC
Default values: