diff options
author | Guillermo Ramos | 2024-03-18 18:55:40 +0100 |
---|---|---|
committer | Guillermo Ramos | 2024-03-18 18:55:46 +0100 |
commit | a412ce9c78cddd4f8438adaac89eac81024a3a2e (patch) | |
tree | 44de32b331f90b600c4660e22fb5d3f16d323ebd | |
parent | 4eccd6aafaf1df75efea97d90d9d6e88ca61452e (diff) | |
download | cli-a412ce9c78cddd4f8438adaac89eac81024a3a2e.tar.gz |
cycle_pa_sinks: fix bug w/ several names
-rwxr-xr-x | cycle_pa_sinks | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cycle_pa_sinks b/cycle_pa_sinks index a45ba15..63c8a48 100755 --- a/cycle_pa_sinks +++ b/cycle_pa_sinks @@ -6,7 +6,7 @@ # Usage: ./cycle_pa_sinks ################################################################################ -new_sink=$(pacmd list-sinks | grep -E "index|device.product.name" | tee /dev/stdout | grep -m1 -A3 "* index" | tail -2) +new_sink=$(pacmd list-sinks | awk '/index/{print; i=1} i&&/device.product.name/{print; i=0}' | tee /dev/stdout | grep -m1 -A3 "* index" | tail -2) new_sink_idx=$(echo "$new_sink" | head -n1 | cut -c12-) new_sink_name=$(echo "$new_sink" | tail -n1 | cut -f2 -d'"') |