aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/script/bar-pipewire
blob: 9f325e2d6f1fdc4deaaa82ebe6cf06e7e81a49e9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/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