mirror of
https://github.com/LibreELEC/LibreELEC.tv
synced 2025-09-24 19:46:01 +07:00
38 lines
979 B
Bash
Executable File
38 lines
979 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
|
|
|
|
. /etc/profile
|
|
oe_setup_addon service.librespot
|
|
|
|
PORT="6666"
|
|
SINK_NAME="librespot_sink"
|
|
|
|
if ! pactl list modules short | grep "sink_name=$SINK_NAME"; then
|
|
pactl load-module module-null-sink sink_name="$SINK_NAME" > /dev/null
|
|
fi
|
|
if ! pactl list modules short | grep "source=$SINK_NAME"; then
|
|
pactl load-module module-rtp-send source="$SINK_NAME.monitor" \
|
|
destination_ip=127.0.0.1 port="$PORT" source_ip=127.0.0.1 > /dev/null
|
|
fi
|
|
pactl suspend-sink "$SINK_NAME" 1
|
|
|
|
LIBRESPOT="librespot \
|
|
--backend pulseaudio \
|
|
--bitrate 320 \
|
|
--cache \"$ADDON_HOME/cache\" \
|
|
--device-type TV \
|
|
--disable-audio-cache \
|
|
--name \"Kodi ($HOSTNAME)\" \
|
|
--notify-kodi"
|
|
|
|
if [ "$ls_a" = "true" -a -n "$ls_p" -a -n "$ls_u" ]; then
|
|
LIBRESPOT="$LIBRESPOT \
|
|
--disable-discovery \
|
|
--password \"$ls_p\" \
|
|
--username \"$ls_u\""
|
|
fi
|
|
|
|
eval $LIBRESPOT
|