fix massive JQ thing to find the names
This commit is contained in:
@ -3,10 +3,14 @@
|
||||
cd ~/Code/dotfiles/scripts
|
||||
status=$(cat ./status)
|
||||
|
||||
speaker_id=$(pw-dump | jq 'map(select(.type == "PipeWire:Interface:Node" and .info.props.["media.class"] == "Audio/Sink" and .info.props.["alsa.card_name"] == "HDA NVidia")) | map({"id"}) | .[].id')
|
||||
|
||||
headphone_id=$(pw-dump | jq 'map(select(.type == "PipeWire:Interface:Node" and .info.props.["media.class"] == "Audio/Sink" and .info.props.["alsa.card_name"] == "Razer Kraken Kitty Edition")) | map({"id"}) | .[].id')
|
||||
|
||||
if [ $status == "speakers" ]; then
|
||||
wpctl set-default 62
|
||||
wpctl set-default $headphone_id
|
||||
echo "headphones" > ./status
|
||||
else
|
||||
wpctl set-default 68
|
||||
wpctl set-default $speaker_id
|
||||
echo "speakers" > ./status
|
||||
fi
|
||||
|
Reference in New Issue
Block a user