1 #!/bin/bash
   2 
   3 function inline(){ # {{{
   4     paste - - | sed \
   5     -e 's/"//g' \
   6     -e 's/\s\+index: /\t/' \
   7     -e 's/\s\+[a-z.]\+name = /\t/'
   8 } # }}}
   9 
  10 if [[ ! $1 ]]; then
  11     pacmd list-sinks | awk '/index/ || /device.product.name/' | inline
  12     exit
  13 fi
  14 
  15 pacmd set-default-sink $1
  16 pacmd list-sink-inputs | awk '/index/ || /\tapplication.name/' | inline |
  17 while read id app; do
  18     echo "[$id] $app";
  19     pacmd move-sink-input $id $1
  20 done
[raw]