getvol 188 B

123456789
  1. #!/bin/sh
  2. # get ALSA master volume in percentage
  3. # (assumes that left and right channel are equal)
  4. amixer get Master \
  5. | tail -n1 \
  6. | awk '{ print $5 }' \
  7. | tr -d '[%]'