summaryrefslogblamecommitdiffstats
path: root/switch_audio
blob: db01feef4cb3994487c2ab542970ba238613e56a (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14













                                                      
#!/bin/sh

#devices
hdmi="alsa_output.pci-0000_01_00.1.hdmi-stereo-extra1"
headphone="alsa_output.pci-0000_00_1f.3.analog-stereo"

curr_device="$(pactl get-default-sink)"

if [ "$curr_device" = $hdmi ]
then
  pactl set-default-sink $headphone
else
  pactl set-default-sink $hdmi
fi