Permalink
Browse files

Add script to start pulse audio daemon at system login, in case it isn't

already loaded
  • Loading branch information...
1 parent 25ff000 commit 2761d27aa78a7c17164d7982c345d8b2bc9973ff @kmoore134 kmoore134 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
@@ -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
@@ -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
+
+ # 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
+fi

0 comments on commit 2761d27

Please sign in to comment.