Update volume scripts
This commit is contained in:
parent
8bba746bca
commit
0f87a8ed80
|
@ -8,9 +8,11 @@ ICONspeakermute="🔕"
|
||||||
ICONspeaker="🔔"
|
ICONspeaker="🔔"
|
||||||
ICONheadphone="🎧"
|
ICONheadphone="🎧"
|
||||||
|
|
||||||
SINKHDMI=alsa_output.pci-0000_01_00.1.hdmi-stereo-extra1
|
#SINKHDMI=alsa_output.pci-0000_01_00.1.hdmi-stereo-extra1
|
||||||
#SINKHDMI=alsa_output.pci-0000_01_00.1.hdmi-stereo
|
SINKHDMI=alsa_output.pci-0000_01_00.1.hdmi-stereo
|
||||||
SINKANALOG=alsa_output.pci-0000_00_1b.0.analog-stereo
|
SINKANALOG=alsa_output.pci-0000_00_1b.0.analog-stereo
|
||||||
|
#alsa_output.pci-0000_00_1b.0.analog-surround-51
|
||||||
|
|
||||||
|
|
||||||
checkDefaultSink() {
|
checkDefaultSink() {
|
||||||
if [ -v LAPTOP ]; then
|
if [ -v LAPTOP ]; then
|
||||||
|
@ -18,7 +20,7 @@ checkDefaultSink() {
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PACTLOUTPUT=`pactl info`
|
PACTLOUTPUT="$(pactl get-default-sink)"
|
||||||
|
|
||||||
if echo $PACTLOUTPUT | grep -q "$SINKANALOG"; then
|
if echo $PACTLOUTPUT | grep -q "$SINKANALOG"; then
|
||||||
SINK=$SINKANALOG
|
SINK=$SINKANALOG
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
SINKHDMI=alsa_output.pci-0000_01_00.1.hdmi-stereo-extra1
|
#SINKHDMI=alsa_output.pci-0000_01_00.1.hdmi-stereo-extra1
|
||||||
#SINKHDMI=alsa_output.pci-0000_01_00.1.hdmi-stereo
|
SINKHDMI=alsa_output.pci-0000_01_00.1.hdmi-stereo
|
||||||
SINKANALOG=alsa_output.pci-0000_00_1b.0.analog-stereo
|
SINKANALOG=alsa_output.pci-0000_00_1b.0.analog-stereo
|
||||||
|
|
||||||
checkDefaultSink() {
|
checkDefaultSink() {
|
||||||
PACTLOUTPUT=`pactl info`
|
PACTLOUTPUT="$(pactl get-default-sink)"
|
||||||
|
|
||||||
if echo $PACTLOUTPUT | grep -q "$SINKANALOG"; then
|
if echo $PACTLOUTPUT | grep -q "$SINKANALOG"; then
|
||||||
SINK=$SINKANALOG
|
SINK=$SINKANALOG
|
||||||
|
@ -19,8 +19,18 @@ changeDefaultSink() {
|
||||||
|
|
||||||
if [ "$SINK" = "$SINKANALOG" ]; then
|
if [ "$SINK" = "$SINKANALOG" ]; then
|
||||||
pactl set-default-sink $SINKHDMI
|
pactl set-default-sink $SINKHDMI
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
INDEX="$(pactl list short cards | grep alsa_card.pci-0000_01_00.1 | cut -d$'\t' -f1)"
|
||||||
|
pactl set-card-profile "$INDEX" output:analog-stereo
|
||||||
|
pactl set-default-sink $SINKHDMI
|
||||||
|
fi
|
||||||
elif [ "$SINK" = "$SINKHDMI" ]; then
|
elif [ "$SINK" = "$SINKHDMI" ]; then
|
||||||
pactl set-default-sink $SINKANALOG
|
pactl set-default-sink $SINKANALOG
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
INDEX="$(pactl list short cards | grep alsa_card.pci-0000_00_1b.0 | cut -d$'\t' -f1)"
|
||||||
|
pactl set-card-profile "$INDEX" output:analog-stereo
|
||||||
|
pactl set-default-sink $SINKANALOG
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue