Permalink
Browse files

Merge branch 'master' of github.com:pcbsd/pcbsd

  • Loading branch information...
2 parents 29ca147 + 3a00741 commit 14505e8c86c161700abffd03d208713125b8ad43 @beanpole135 beanpole135 committed Mar 5, 2014
Showing with 22 additions and 0 deletions.
  1. +1 −0 src-qt4/port-files/pkg-plist
  2. +21 −0 src-qt4/xtrafiles/local/share/pcbsd/xstartup/startpulseaudio.sh
View
1 src-qt4/port-files/pkg-plist
@@ -51,6 +51,7 @@ share/pcbsd/xstartup/enable-ibus.sh
share/pcbsd/xstartup/checkupdater.sh
share/pcbsd/xstartup/life-preserver.sh
share/pcbsd/xstartup/screensaver.sh
+share/pcbsd/xstartup/startpulseaudio.sh
share/pcbsd/xstartup/vkeyboard.sh
share/pcbsd/xstartup/setmix.sh
share/pcbsd/xstartup/pc-mounttray.sh
View
21 src-qt4/xtrafiles/local/share/pcbsd/xstartup/startpulseaudio.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+# Check if we need to start pulseaudio on this login
+
+if [ "`id -u`" = "0" ] ; then return ; fi
+
+# Do we have pulseaudio?
+which pulseaudio >/dev/null 2>/dev/null
+if [ $? -ne 0 ]; then exit 0; fi
+
+# Check if we need to start it
+pulseaudio --check
+if [ $? -ne 0 ] ; then
+ # Start pulseaudio
+ pulseaudio --start
+fi
+
+# Get the default unit
+dU=`sysctl hw.snd.default_unit | awk '{print $2}'`
+
+# Set the default sink to match default audio device
+pactl set-default-sink $dU

0 comments on commit 14505e8

Please sign in to comment.