Created
November 19, 2023 10:29
-
-
Save gavlooth/2f962e7410ef5036e6c5f6c5fb87831c to your computer and use it in GitHub Desktop.
Get the name of current audio device
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env zsh | |
pactl --format=json list cards |jq -c '.[] | select (.name | contains('\"$(pactl --format=json info | jq . |jq ".default_sink_name" | cut -d"." -f2)\"'))?' | jq '.properties."device.description"' | xargs -n 1 echo "Audio Device: " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
One liner that uses pactl and jq to get the "device name" for the current audio devices. It takes advadage of pactl json output option and jq's superior json manipulation capabilities