brndnmtthws / conky

Light-weight system monitor for X, Wayland (sort of), and other things, too
https://conky.cc
GNU General Public License v3.0
7.17k stars 615 forks source link

$pa_sink_volume and ${pa_sink_volumebar} not updating values #417

Open moorhexa opened 7 years ago

moorhexa commented 7 years ago

I added the pulse audio settings to my conky. They show the state of my default sink at start of conky as aspected, but do not change their values, when changing pulseaudio volume.

lasers commented 6 years ago

Hi. Is this still a problem for you? How did you change pulseaudio volumes? Is it possible that you were changing alsa volume or changed volume on different sink instead of default sink? Did you compare with pulseaudio tools too (eg pactl list sinks) to see if anything matches up to your new value?

EDIT: Everything seems okay for me. Not sure what to make out of this. Please test this again. :-)

lasers commented 6 years ago

@su8 pa_sink_volumebar looks broken to me. I expect something like ###___ instead of \n

conky.config = {out_to_x=true,out_to_console=true}
conky.text = [[
pa_sink_volume // ${pa_sink_volume} //
pa_sink_volumebar // ${pa_sink_volumebar} //
pa_sink_description // ${pa_sink_description} //
pa_sink_active_port_name // ${pa_sink_active_port_name} //
pa_sink_active_port_description // ${pa_sink_active_port_description} //
pa_card_name // ${pa_card_name} //
pa_card_active_profile // ${pa_card_active_profile} //
---------------
]]
pa_sink_volume // 40 //                                                                      
pa_sink_volumebar // 
 //
pa_sink_description // Built-in Audio Analog Stereo //
pa_sink_active_port_name // analog-output-lineout //
pa_sink_active_port_description // Line Out //
pa_card_name // alsa_card.pci-0000_00_1b.0 //
pa_card_active_profile // Analog Stereo Duplex //
---------------
lasers commented 6 years ago

Never mind about the bar. It's the {out_to_x=true,out_to_console=true} issue. Changing out_to_x to false made the bar works okay with out_to_console.

Like I mentioned last week, everything seems okay for me here so I'm not sure what to make of this... I'll close this until you come back with more information, your config, etc. Thank you.

Here's my screenshot with pa_* variables mentioned above.

2018-08-13-224829_695x483_scrot

LinuxOnTheDesktop commented 3 years ago

I think this bug should be reopened. For, I have this problem, or at least a similar one. Here's my code.

${if_pa_sink_muted}\
${color8}x\
${else}\
${if_match ${pa_sink_volume} >0}\
${color1}\
${else}\
${color8}\
${endif}\
${pa_sink_volume}%\
${endif}\

The problem

Sometimes the volume figure gets stuck, such that I can raise or lower the volume, and Conky shows the change only after I restart Conky.

My system

Conky 1.11.6_pre (later versions, last time I tried, had spacing problems). How installed: built from git PC: X1 Carbon Generation 6 ThinkPad OS: Mint 20 x64 Cinnamon. Kernel: 5.9.16

LinuxOnTheDesktop commented 3 years ago

Thanks for re-opening. Please note that in order to work around this - in order to reliably read the volume - I am having to run awk every Conky tick, which is somewhat expensive.

LinuxOnTheDesktop commented 3 years ago

Cf. perhaps #319.

LinuxOnTheDesktop commented 3 years ago

A workaround

Here is the source code for a fast C program that displays the volume or, if the volume is muted, an 'x'.

Compile (instructions for that are in the code) and then invoke thusly within Conky:

# ${if_pa_sink_muted} is broken. Workaround (to show 'x' if muted or otherwise show the volume):
${exec ~/scripts/conky/c/volume_exec}\
cinergytv commented 2 years ago

Setting background = yes in my .conkyrc solved this for me.

github-actions[bot] commented 11 months ago

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.

LinuxOnTheDesktop commented 11 months ago

Bad bot.