diff options
author | Runciter | 2024-05-25 07:47:22 +0800 |
---|---|---|
committer | Runciter | 2024-05-25 07:47:22 +0800 |
commit | c45395cace17333a020532f6239869ea2c799016 (patch) | |
tree | 39e2ff046a14512ce9d8ff58ce587539886cc00d | |
parent | ab3ed370aea207ca16903b452170799919bec6ee (diff) | |
download | sh-pulse-c45395cace17333a020532f6239869ea2c799016.tar.gz |
Add volume increment setting capability.
M README
Expanded.
M vlm
Add INC argument to increase and decrease sub-commands.
Expand usage information output.
-rw-r--r-- | README | 20 | ||||
-rwxr-xr-x | vlm | 19 |
2 files changed, 34 insertions, 5 deletions
@@ -1,2 +1,18 @@ -The vlm script helps the user to easily set keyboard shortcuts to -control pulseaudio volume, mute and switch pulseaudio output.
\ No newline at end of file +The vlm script provides elementary sound control actions to set +pulseaudio volume, mute or unmute sound and cycle through pulseaudio +outputs, such that actions performed through this script will probably +achieve sane results on all systems using pulseaudio. The script does +not need any configuration from the user to perform its actions. + +It is provided so that the user can bind the script's actions to +keyboard shortcuts of his choosing, and have those shortcuts trigger +easy and consistent sound control actions. + +Because the script's capabilities are not exhaustive, and because it +does not provide any output about their effects, it can not replace a +full-blown sound mixer program. + +The script uses the pactl program to determine the currently active +pulseaudio sink, then uses the same command again to perform its action. + +For usage information, type the command vlm without any argument. @@ -45,10 +45,20 @@ fi case "$1" in increase) - pactl set-sink-volume ${SINKS[$IS]} "+5%" + if test "x$2" = "x" + then + pactl set-sink-volume ${SINKS[$IS]} "+5%" + else + pactl set-sink-volume ${SINKS[$IS]} $2 + fi ;; decrease) - pactl set-sink-volume ${SINKS[$IS]} "-5%" + if test "x$2" = "x" + then + pactl set-sink-volume ${SINKS[$IS]} "-5%" + else + pactl set-sink-volume ${SINKS[$IS]} $2 + fi ;; togglemute) pactl set-sink-mute ${SINKS[$IS]} toggle @@ -67,7 +77,10 @@ case "$1" in done ;; *) - echo "Usage: /usr/local/bin/pavolctrl {increase|decrease|togglemute|nextsink}" + echo "Usage: vlm {increase [INC]|decrease [INC]|togglemute|nextsink}" + echo " Volume increment INC is given as is to pactl." + echo " Default INC is +5% for increase, -5% for decrease." + echo " nextsink cycles audio outputs e.g. sound cards, usb, ..." exit 2 ;; esac |