bar-volume.sh 412 B

123456789
  1. #!/usr/bin/env bash
  2. set -euo pipefail # bash strict mode
  3. #vol=`amixer get Master | awk -F'[][]' 'END{ print $2" "$4 }' | sed 's/on://g'`
  4. # vol=$(pamixer --get-volume)
  5. # amixer -c 0 set Master "$@" > /dev/null
  6. vol="$(amixer -c 0 get Master | tail -1 | awk '{print $4}' | sed 's/[^0-9]*//g')"
  7. # vol=$(pactl list sinks | grep "RUNNING\|IDLE" -A 9 | grep "Volume: " | cut -d/ -f2 | tr -d '% ')
  8. echo -e "VOL:${vol}%"