i3volume.sh 353 B

123456789101112131415
  1. #!/bin/sh
  2. case $BLOCK_BUTTON in
  3. 1) amixer -D pulse sset Master toggle; ;;
  4. 2) ;;
  5. esac
  6. state=$(amixer -D pulse sget Master | awk '/Front Left:/ {print $6}' | sed -r 's/\[(.*)\]/\1/g')
  7. if [ "$state" = "off" ] ;then
  8. echo " muted"
  9. else
  10. echo " $(amixer -D pulse sget Master | awk '/Front Left:/ {print $5}' | sed -r 's/\[(.*)\]/\1/g')"
  11. fi