dernik

sound switch

Mar 17th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.85 KB | None | 0 0
  1. #!/bin/bash
  2. case $1 in
  3.     10)
  4.         newSink=$(pactl list short sinks | grep pci-0000_04_00.0.analog-stereo | awk '{print $1}')
  5.         pactl set-card-profile 3 output:analog-stereo
  6.     ;;
  7.     11)
  8.         newSink=$(pactl list short sinks | grep pci-0000_04_00.0.iec958-stereo | awk '{print $1}')
  9.         pactl set-card-profile 3 output:iec958-stereo
  10.     ;;
  11.     12)
  12.         newSink=$(pactl list short sinks | grep UAC1_DAC-01.analog-stereo | awk '{print $1}')
  13.         pactl set-card-profile 2 output:analog-stereo
  14.     ;;
  15.     13)
  16.         newSink=$(pactl list short sinks | grep pci-0000_01_00.1.hdmi-stereo | awk '{print $1}')
  17.         pactl set-card-profile 0 output:hdmi-stereo
  18.     ;;
  19. esac
  20.  
  21. pactl list short sink-inputs|while read stream; do
  22.     streamId=$(echo $stream| awk '{print $1}')
  23.     pactl move-sink-input "$streamId" "$newSink"
  24. done
Advertisement
Add Comment
Please, Sign In to add comment