1234567891011121314151617181920212223 |
- #!/bin/sh
- vol="$(pamixer --get-volume)"
- vol="${vol#Volume: }"
- split() {
- IFS=$2
- set -- $1
- printf '%s' "$@"
- }
- vol="$(printf "%.0f" "$(split "$vol" ".")")"
- case 1 in
- $((vol >= 50)) ) icon=" " ;;
- $((vol >= 30)) ) icon=" " ;;
- $((vol >= 0)) ) icon=" " ;;
- * ) echo && exit ;;
- esac
- echo "$icon$vol%"
|