#!/bin/sh pw_status="$(wpctl get-volume @DEFAULT_AUDIO_SINK@)" pw_volume="$(echo "$pw_status" | awk '{ print $2*100 }')" pw_muted="$(echo "$pw_status" | grep "MUTED")" if [ -n "$pw_muted" ]; then printf " muted\n" elif [ "$pw_volume" -lt 30 ]; then printf " %s%%\n" "$pw_volume" else printf " %s%%\n" "$pw_volume" fi