#!/bin/sh

# Prints the current volume or 婢 if muted.

vol="$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
# If muted, print 婢 and exit.
[ "$vol" != "${vol%\[MUTED\]}" ] && echo 婢 && exit

vol="$(echo "(""$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | cut -d' ' -f2)"*100")/1" | bc)"
case 1 in
	$((vol >= 70)) ) icon=" " ;;
	$((vol >= 30)) ) icon=" " ;;
	$((vol >= 1)) ) icon=" " ;;
	* ) echo 婢 && exit ;;
esac

echo "$icon$vol%"