volume 320 B

1234567891011121314151617181920212223
  1. #!/bin/sh
  2. vol="$(pamixer --get-volume)"
  3. vol="${vol#Volume: }"
  4. split() {
  5. IFS=$2
  6. set -- $1
  7. printf '%s' "$@"
  8. }
  9. vol="$(printf "%.0f" "$(split "$vol" ".")")"
  10. case 1 in
  11. $((vol >= 50)) ) icon=" " ;;
  12. $((vol >= 30)) ) icon=" " ;;
  13. $((vol >= 0)) ) icon="󰕿 " ;;
  14. * ) echo 󰝟 && exit ;;
  15. esac
  16. echo "$icon$vol%"