source: src-qt4/xtrafiles/local/share/pcbsd/xstartup/startpulseaudio.sh @ 2761d27

releng/10.0.1releng/10.0.2releng/10.0.3releng/10.1
Last change on this file since 2761d27 was 2761d27, checked in by Kris Moore <kris@…>, 8 months ago

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

  • Property mode set to 100755
File size: 494 bytes
Line 
1#!/bin/sh
2# Check if we need to start pulseaudio on this login
3
4if [ "`id -u`" = "0" ] ; then return ; fi
5
6# Do we have pulseaudio?
7which pulseaudio >/dev/null 2>/dev/null
8if [ $? -ne 0 ]; then exit 0; fi
9
10# Check if we need to start it
11pulseaudio --check
12if [ $? -ne 0 ] ; then
13   # Start pulseaudio
14   pulseaudio --start
15
16   # Get the default unit
17   dU=`sysctl hw.snd.default_unit | awk '{print $2}'`
18
19   # Set the default sink to match default audio device
20   pactl set-default-sink $dU
21fi
Note: See TracBrowser for help on using the repository browser.