You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.3 KiB
41 lines
1.3 KiB
#!/usr/bin/bash
|
|
|
|
ENABLED=yes
|
|
[[ ${ENABLED} == "yes" ]] || { return 0 2>/dev/null && return 0 || exit 0; }
|
|
DEBUGMODE=no
|
|
|
|
unset ROOTFS; [[ -d /usr/lib/ublinux ]] || ROOTFS=.
|
|
SOURCE=${ROOTFS}/usr/lib/ublinux/functions; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null || exit 0
|
|
SOURCE=${ROOTFS}/usr/lib/ublinux/default; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null || exit 0
|
|
debug_mode "$0" "$@"
|
|
|
|
SYSCONF="${ROOTFS}${SYSCONF}"
|
|
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
|
|
SOURCE=${SYSCONF}/hardware; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
|
|
|
|
[[ -z "${PULSEAUDIO}" ]] && PULSEAUDIO="default"
|
|
|
|
function pulse(){
|
|
ln -sfT /etc/sound/profiles/pulse /etc/alternatives/soundprofile
|
|
sed -i 's|^.*autospawn.*$|autospawn = yes|' /etc/pulse/client.conf
|
|
# sed -i 's|^.*PULSE_SERVER_TYPE.*$|PULSE_SERVER_TYPE=personal|' /etc/ublinux/pulseaudio
|
|
echo " Soundprofile switched to PULSEAUDIO"
|
|
}
|
|
|
|
function alsa(){
|
|
ln -sfT /etc/sound/profiles/alsa /etc/alternatives/soundprofile
|
|
sed -i 's|^.*autospawn.*$|autospawn = no|' /etc/pulse/client.conf
|
|
# sed -i 's|^.*PULSE_SERVER_TYPE.*$|PULSE_SERVER_TYPE=none|' /etc/ublinux/pulseaudio
|
|
echo " Soundprofile switched to ALSA"
|
|
}
|
|
|
|
function default(){
|
|
true
|
|
}
|
|
|
|
case "${PULSEAUDIO,,}" in
|
|
"default") default ;;
|
|
"no"|"disable"|"off") alsa ;;
|
|
* ) pulse ;;
|
|
esac
|