Update volume block

This commit is contained in:
Santiago Lo Coco 2022-03-04 22:04:41 -03:00
parent 6317d046f1
commit 3e4cda0212
2 changed files with 12 additions and 0 deletions

View File

@ -14,6 +14,11 @@ SINKHDMI=alsa_output.pci-0000_01_00.1.hdmi-stereo
SINKANALOG=alsa_output.pci-0000_00_1b.0.analog-stereo
checkDefaultSink() {
if [ -v LAPTOP ]; then
SINK=$SINKANALOG
return
fi
PACTLOUTPUT=`pactl info`
if echo $PACTLOUTPUT | grep -q "$SINKANALOG"; then
@ -42,6 +47,11 @@ getIcon() {
fi
fi
if [ -v LAPTOP ]; then
printf "$ICON %s" "$VOLUME%"
return
fi
if [ "$SINK" = "$SINKHDMI" ]; then
printf "$ICON %s" "$VOLUME%"
elif [ "$SINK" = "$SINKANALOG" ]; then

View File

@ -15,6 +15,8 @@ checkDefaultSink() {
}
changeDefaultSink() {
[ -v LAPTOP ] && return
if [ "$SINK" = "$SINKANALOG" ]; then
pactl set-default-sink $SINKHDMI
elif [ "$SINK" = "$SINKHDMI" ]; then