#!/bin/sh

#shellcheck disable=SC2068
wpctl $@
vol=$(wpctl get-volume @DEFAULT_SINK@)
vol_int=$(printf '%s' "$vol" | tr -cd '[:digit:]')
vol_icon="low"
[ "$vol_int" -gt 33 ] && vol_icon="medium"
[ "$vol_int" -gt 66 ] && vol_icon="high"
printf '%s' "$vol" | grep -q 'MUTED' && vol_icon="muted"
notify-send -e -i "/usr/share/icons/Papirus/16x16/panel/audio-volume-$vol_icon.svg" "$vol_int %" -h "string:x-canonical-private-synchronous:${0##*/}" -t 1000
