Browse files

After devd notifies us of a new audio device and we switch to it, als…

…o switch

pulseaudio to using it by default
  • Loading branch information...
1 parent 73f107f commit 25ff000dff3a00834d6db17dc03aa0438d8507c1 @kmoore134 kmoore134 committed Mar 5, 2014
Showing with 6 additions and 0 deletions.
  1. +6 −0 src-qt4/xtrafiles/local/share/pcbsd/scripts/sound-dev-changed.sh
View
6 src-qt4/xtrafiles/local/share/pcbsd/scripts/sound-dev-changed.sh
@@ -81,6 +81,12 @@ set_new_dev()
# make new device the default one
sysctl hw.snd.default_unit=$mixerNum
+ # Look for pulseaudio daemons to change audio sinks on
+ for user in `ps -auwwx | grep 'pulseaudio --start' | grep -v 'grep' | awk '{print $1}'`
+ do
+ su $user -c "pactl set-default-sink $mixerNum"
+ done
+
}
# Update device based upon action

0 comments on commit 25ff000

Please sign in to comment.