From d73e0a03ca657537f591840fb5f23b3de9e07eca Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Fri, 23 Mar 2018 18:16:16 -0400 Subject: [PATCH] Latest changes to make_fenrir_user.sh --- tools/make_fenrir_user.sh | 44 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/tools/make_fenrir_user.sh b/tools/make_fenrir_user.sh index 4e0d7161..fad65cbc 100755 --- a/tools/make_fenrir_user.sh +++ b/tools/make_fenrir_user.sh @@ -6,6 +6,47 @@ if [[ "$(whoami)" != "root" ]]; then exit 1 fi +write_pulse() { +sudo -u fenrirscreenreader cat << EOF > "/var/fenrirscreenreader/.config/pulse/client.conf" +# This file is part of PulseAudio. +# +# PulseAudio is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# PulseAudio is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with PulseAudio; if not, see . + +## Configuration file for PulseAudio clients. See pulse-client.conf(5) for +## more information. Default values are commented out. Use either ; or # for +## commenting. + +; default-sink = +; default-source = +default-server = unix:/tmp/pulse.sock +; default-dbus-server = + +autospawn = no +; autospawn = yes +; daemon-binary = /usr/bin/pulseaudio +; extra-arguments = --log-target=syslog + +; cookie-file = + +; enable-shm = yes +; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB + +; auto-connect-localhost = no +; auto-connect-display = no +EOF +} + # This script checks for, and creates if needed, the fenrirscreenreader user. # Find out which group to use for uinput @@ -36,8 +77,9 @@ fi # Add fenrirscreenreader id fenrirscreenreader &> /dev/null || { useradd -m -d /var/fenrirscreenreader -r -G $input,$tty,$uinput -s /bin/nologin -U fenrirscreenreader; + sleep 1; sudo -u fenrirscreenreader mkdir -p /var/fenrirscreenreader/.config/pulse; - sudo -u fenrirscreenreader echo -e '.include /etc/pulse/default.pa\nload-module module-switch-on-connect\nload-module module-native-protocol-unix auth-anonymous=1 socket=/tmp/pulse.sock' > /var/fenrirscreenreader/.config/pulse/default.pa; + write_pulse; } #configure directory structure.