Closed stardiviner closed 11 months ago
@stardiviner So I tried this on my computer (no battery). They all printed BAT1
for me. Maybe, we need more information or your config. What conky version? conky -V | head -n1
.
conky: desktop window (25a) is root window
conky: window type - desktop
conky: drawing to created window (0x3800001)
conky: can't open /sys/class/power_supply/BAT1/uevent: No such file or directory
conky: can't open /proc/acpi/battery/BAT1/state: No such file or directory
conky: can't open /proc/apm: No such file or directory
conky: can't open /sys/class/power_supply/BAT1/uevent: No such file or directory
conky: can't open /proc/acpi/battery/BAT1/state: No such file or directory
Seems like most of them are in in core.cc
.
src/core.cc: strncpy(bat, "BAT0", 5);
src/core.cc: strncpy(bat, "BAT0", 5);
src/core.cc: END OBJ(battery_status, 0) obj->data.s = strndup(arg ? arg : "BAT0", text_buffer_size.get(*state));
src/core.cc: strncpy(bat, "BAT0", 5);
src/core.cc: strncpy(bat, "BAT0", 5);
src/core.cc: strncpy(bat, "BAT0", 5);
src/core.cc: strncpy(bat, "BAT0", 5);
src/core.cc: strncpy(bat, "BAT0", 5);
src/core.cc: END OBJ(battery_status, 0) obj->data.s = strndup(arg ? arg : "BAT0", text_buffer_size.get(*state));
src/core.cc: strncpy(bat, "BAT0", 5);
src/core.cc: strncpy(bat, "BAT0", 5);
src/core.cc: strncpy(bat, "BAT0", 5);
But I wonder if it is because of update_interval_on_battery
since this part seems hardcoded.
#endif /* BUILD_XSHAPE */
last_update_time = 0.0;
next_update_time = get_time() - fmod(get_time(), active_update_interval());
info.looped = 0;
while (terminate == 0
&& (total_run_times.get(*state) == 0 || info.looped < total_run_times.get(*state))) {
if(update_interval_on_battery.get(*state) != NOBATTERY) {
char buf[64];
get_battery_short_status(buf, 64, "BAT0");
on_battery = (buf[0] == 'D');
}
info.looped++;
Do you still get that message with default.conf
? What about with update_interval_on_battery
? Do you have that set? See if we can rule this one out or narrow down something somewhere.
My conky version: conky 1.11.0_pre
This error does not appears with default config /usr/share/doc/conky-1.11.0_pre/conky.conf
.
With update_interval_on_batter
added in the default config. I still get same error.
What caused BAT0
in your config? Was it update_interval_on_battery
or one of the battery
variables? If latter, does it happen with all of them or with one of the variables?
Also, see detect_battery
. Maybe you need to add "BAT0,BAT1"
or "BAT1"
?
What caused BAT0 in your config? Was it update_interval_on_battery or one of the battery variables? If latter, does it happen with all of them or with one of the variables?
I only added one line update_interval_on_battery = 2
in default config /usr/share/doc/conky-1.11.0_pre/conky.conf
. Then start conky with conky -c /usr/share/doc/conky-1.11.0_pre/conky.conf
. Before adding that line, no this error. After adding that line, this error raised.
After adding line detect_battery = "BAT0,BAT1"
. Problem still persists. BTW, I indeed don't have that file. I even don't have /proc/acpi/battery/
path.
I was looking into this a little (no code yet). I didn't find the solution to the problem, but I found out some things.
On my system (running Arch Linux (5.1.7-arch1-1-ARCH)) I tried out the partial config from the original question. My laptop battery is numbered BAT0
, so the BAT1
in the config causes conky errors, but none of them defaults to BAT0
(whether or not the update_interval_on_battery
option is used).
Having the actual config files that display this problem (and the configs where the problem doesn't happen) might help.
I have detect_battery = "BAT0,BAT1",
in my conky config. It should be detected. Also I have BAT0
explicitly specified in code like this ${battery BAT0}
.
This issue is stale because it has been open 365 days with no activity. Remove stale label or comment, or this issue will be closed in 30 days.
This issue was closed because it has been stalled for 30 days with no activity.
When I start conky from terminal , it reports error:
But I didn't use
BAT0
in my conky config file:And I only have
BAT1
:In
/sys/class/power_supply/BAT1
. I got: