The current way to set volume looks like this: % pacmd info |grep Default Default sample spec: s16le 2ch 44100Hz Default channel map: front-left,front-right Default sink name: alsa_output.pci-0000_00_14.5.analog-stereo Default source name: alsa_input.pci-0000_00_14.5.analog-stereo *** copy default sink name *** % pactl set-sink-volume alsa_output.pci-0000_00_14.5.analog-stereo 80% It works, but surely there is room for improvement. Maybe something like % pactl set-sink-volume default 80% Or maybe even % pactl set-sink-volume 80%
Another possibility: % pactl set-volume "$(pactl get-default-sink)"
I've since found @DEFAULT_SINK@. So looks like my first idea was already implemented. pactl get-default-sink would still be useful, though, for situations like % pacat -d "$(pactl get-default-sink).monitor" ...
(In reply to Eric Toombs from comment #2) > I've since found @DEFAULT_SINK@. So looks like my first idea was already > implemented. pactl get-default-sink would still be useful, though, for > situations like > > % pacat -d "$(pactl get-default-sink).monitor" ... That particular example doesn't need any new features, because you can use @DEFAULT_MONITOR@. More generally, though, I think it would be nice if pactl would have more fine-grained querying capabilities for situations where you need just one bit of information in a script (also, the current info/list commands are not guaranteed to not change their output format, so parsing pactl output in scripts is a bit fragile).
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/445.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.