Updated: 25 March 2017
- Control pulseaudio's basic functions such as the master volume level and mute status from a mapped key.
pulseaudio-ctl [option1] [option2]
Recommended usage of pulseaudio-ctl
is to map a call to the script (see below) to a single keypress for easy access to change mute status or quickly adjust master volume levels. Many keyboards have keys specific to these particular actions and many if not all DE or WMs offer the ability to natively map a script call to a keypress or combo of key presses. For example, xfce4 allows for this under Settings > Keyboard > Application Shortcuts.
- Persistent options are stored in $HOME/.config/pulseaudio-ctl/config which is sufficiently commented for users to understand.
Inspect this file and uncomment those that suit your needs.
Adjust master volume up by 5 % (default) or up by another value defined as the 2nd token
Adjust master volume down by 5 % (default) or down by another value defined as the 2nd token
Set the mute status of the master volume to the value defined in the 2nd token. Toggle by default.
Set the mute status of the input device (microphone for example) to the value defined in the 2nd token. Toggle by default.
Set the master volume level to the number specified as the 2nd token
Like the 'set' option only takes effect if the current volume is higher than the 2nd token
Print the current volume level to STDOUT
Print the current volume level, the sink mute state and the source mute state to STDOUT
Increase vol level by 5 %
Increase vol level by 25 %
/usr/bin/pulseaudio-ctl up 25
Toogle mute current output
Unmute current output
/usr/bin/pulseaudio-ctl mute no
Set current vol level to 85 %
/usr/bin/pulseaudio-ctl set 85
Should you wish to contribute to this code, please fork and send a pull request. Source is freely available on github: https://github.com/graysky2/pulseaudio-ctl
graysky (graysky AT archlinux DOT us)