Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$audaciuos_filename is always empty #1175

Closed
z1atk0 opened this issue Feb 18, 2022 · 6 comments · Fixed by #2038
Closed

$audaciuos_filename is always empty #1175

z1atk0 opened this issue Feb 18, 2022 · 6 comments · Fixed by #2038
Labels
audio Issue or PR related to audacious, pulseaudio, and other audio components bug Bug report or bug fix PR text Issue or PR related to `conky.text` variables

Comments

@z1atk0
Copy link
Contributor

z1atk0 commented Feb 18, 2022

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
[...]
};
@github-actions
Copy link

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.

@github-actions github-actions bot added the Stale Issue/PR that requires attention because it hasn't been updated in over a year label Feb 19, 2023
@z1atk0
Copy link
Contributor Author

z1atk0 commented Mar 5, 2023

Seems to be fixed as of conky-1.18.2, audaciuos-4.2, libaudclient-3.5-rc2, gcc-/g++-11.2.0 on Slackware-15.0 x86_64.

@z1atk0 z1atk0 closed this as not planned Won't fix, can't repro, duplicate, stale Mar 5, 2023
@z1atk0 z1atk0 reopened this Mar 5, 2023
@z1atk0
Copy link
Contributor Author

z1atk0 commented Mar 5, 2023

Nope, sorry, my mistake - also still present as of conky-1.18.2, audaciuos-4.2, libaudclient-3.5-rc2, gcc-/g++-11.2.0 on Slackware-15.0 x86_64.

@github-actions github-actions bot removed the Stale Issue/PR that requires attention because it hasn't been updated in over a year label Mar 6, 2023
Copy link

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.

@github-actions github-actions bot added the Stale Issue/PR that requires attention because it hasn't been updated in over a year label Mar 19, 2024
@z1atk0
Copy link
Contributor Author

z1atk0 commented Mar 19, 2024

Still present in conky-1.19.8. Yes, I'll also try and come up with a PR here. 😉

@github-actions github-actions bot removed the Stale Issue/PR that requires attention because it hasn't been updated in over a year label Mar 20, 2024
@Caellian Caellian added the bug Bug report or bug fix PR label Apr 12, 2024
@Caellian Caellian added audio Issue or PR related to audacious, pulseaudio, and other audio components text Issue or PR related to `conky.text` variables labels Apr 25, 2024
z1atk0 added a commit to z1atk0/conky that referenced this issue Sep 20, 2024
…_filename

print_audacious_filename() always returns an empty (zero-length) $audacious_filename, due to one of the std::min() operators always being 0. Removing the std::min() construct fixes the problem. Fixes brndnmtthws#1175.
@z1atk0
Copy link
Contributor Author

z1atk0 commented Sep 20, 2024

PR ✔️ done (finally!), see #2038. I hope I did everything right, feel free to correct/fix the PR in case I screwed up. 😇 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
audio Issue or PR related to audacious, pulseaudio, and other audio components bug Bug report or bug fix PR text Issue or PR related to `conky.text` variables
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants