conky
conky copied to clipboard
$audaciuos_filename is always empty
Issue
The $audaciuos_filename
variable is always empty. Using dbus-monitor
I found out that conky
is actually receiving the correct answer from the dbus query via libaudclient
, so after a bit of debugging I found out that the problem is in print_audacious_filename()
. From src/audaciuos.cc
:
void print_audacious_filename(struct text_object *obj, char *p,
unsigned int p_max_size) {
snprintf(p, std::min((unsigned int)obj->data.i, p_max_size), "%s",
get_res().filename.c_str());
}
At least on my system, obj->data.i
is always 0
, so the whole std::min((unsigned int)obj->data.i, p_max_size)
construct also evaluates to 0
, resulting in an empy (ie. 0 characters long) string. Replacing the whole std::min()
construct with simply p_max_size
(as in print_audacious_status()
) fixes the problem.
Information
conky-1.12.2
, audaciuos-4.1
, libaudclient-3.5-rc2
, gcc-/g++-9.2.0
on Slackware-14.2
(32bit).
conky.text = {
[...]
${if_running audacious}${color black}$hr
Audacious: ${color grey}$audacious_status ($audacious_playlist_length songs)
$color${scroll 32 ${audacious_title 256}}
${color grey}[$audacious_position / $audacious_length]
${audacious_bar 8,312}
${if_empty audacious_filename}NIX!${else}${eval $${image ${eval $${exec dirname ${eval $${exec sed -e 's,^file://,,' <<< $audacious_filename}}}}/.folder.png -p 320,852 -s 72x72}}$endif
$endif
[...]
};