dot_testing/simplestatus/volume

10 lines
284 B
Bash
Executable File

#!/bin/sh
if [ "$(ps aux | grep pulseaudio | wc -l)" -eq 2 ]; then
text="$(pactl list sinks | awk -F' ' '$1 == "Volume:" {print $5}')"
printf "pv%s" "$text"
else
text="$(amixer | grep '^ Front' | awk -F'[' '{ ORS = ""; print substr($2, 1, 3); exit }')"
printf "av%s" "$text"
fi