You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
633 B

#!/bin/sh
vol="$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk '{print $2}' | sed -e 's/\.//g' | sed 's/^0*//')"
if [ "$vol" -eq "0" ]; then
vol_info="^b#282828^^c#dfdfdf^  ^d^"
elif [ "$vol" -gt "70" ]; then
vol_info="^b#282828^^c#dfdfdf^  ^d^"
else
vol_info="^b#282828^^c#dfdfdf^  ^d^"
fi
$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | grep -q '\[MUTED\]') && vol_info="^c#ff0000^ ^d^"
if wpctl get-volume @DEFAULT_SOURCE@ | grep -q '\[MUTED\]'; then
mic="^b#282828^^c#ff0000^  ^d^"
else
mic="^b#282828^^c#dfdfdf^  ^d^"
fi
vol=$(printf %3s $vol | tr ' ' ' ')
printf "%s %s %s %s\\n" "$mic" "$vol_info" "$vol%"