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

releng/10.0.1releng/10.0.2releng/10.0.3releng/10.1releng/10.1.1releng/10.1.2
Last change on this file since ad36b59 was ad36b59, checked in by Kris Moore <kris@…>, 14 months ago

Set default pulseaudio sink if daemon is already running

  • Property mode set to 100755
File size: 482 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
15fi
16
17# Get the default unit
18dU=`sysctl hw.snd.default_unit | awk '{print $2}'`
19
20# Set the default sink to match default audio device
21pactl set-default-sink $dU
Note: See TracBrowser for help on using the repository browser.