A feature-full Polybar module to control PulseAudio
[#70, #71] Add --listen-timeout-secs
flag. This also updates its default value from 0.1
to 0.05
. From the new FAQ in the README:
We use the
pactl subscribe
command to get notified of new events that may occur in order to refresh the output. However, the command often outputs a lot of events for a simple action, like increasing the volume. Instead of refreshing for every single line it prints, we:
- Wait for one event
- Update the output first
- Continue to listen for events until a timeout ends, or until we reach a large enough number of them
- Update the output again
- Go back to step 1
This way, the first event will update quickly, and the following ones, which are most likely unnecessary, will be ignored until some time passes. This reduces the CPU usage, but it's not really perfect, as everyone percieves latency differently, and it depends on the use-case.
The timer can be configured with
--listen-timeout-secs
, which has a default value of0.05
(50 ms). If you want less CPU usage, i.e., ignore more duplicate events, you can bump it to, for example,0.1
(100 ms). Or for faster refreshes when performing multiple actions quickly, e.g., updating the volume with your mousewheel, you can even use a smaller value.
--node-type
argument to select whether to use sinks (speakers) or sources (microphones). This makes it possible to also control microphones with the script exactly in the same ways as before: volume control, switching between them, muting, etc.
Thus, many arguments and options have been renamed to be generic over both sinks and sources, under the name node
:
next-sink
action is now next-node
--icon-sink
argument is now --icon-node
--sink-blacklist
argument is now --node-blacklist
--sink-nicknames-from
argument is now --node-nicknames-from
--sink-nickname
argument is now --node-nickname
ICON_SINK
variable is now ICON_NODE
SINK_NICKNAME
variable is now NODE_NICKNAME
These items are deprecated for now so that it's easy to find out about the changes, but they will be removed in a future version. Check out the README
and the --help
message for more information about this new feature.
--osd action
would ignore the action
parameter, for example).Many thanks to @Aerion for working on most of these features! Especially supporting both sinks and sources, which should make this script much more flexible.
Full Changelog: https://github.com/marioortizmanero/polybar-pulseaudio-control/compare/v2.3.0...v3.0.0
--icons-volume
and --sink-blacklist
now remove spacing between items. Both A, B, C
and A,B,C
are valid values now.