Experimental chromecasting support added. This likely needs more work.
This commit is contained in:
parent
9c8c253d03
commit
15539bd163
17
radio.sh
17
radio.sh
@ -45,14 +45,25 @@ url="$(dialog --clear \
|
|||||||
--extra-button \
|
--extra-button \
|
||||||
--extra-label "Record and Listen" \
|
--extra-label "Record and Listen" \
|
||||||
--ok-label "Listen" \
|
--ok-label "Listen" \
|
||||||
--cancel-label "Exit" \
|
--cancel-label "Cast" \
|
||||||
|
--help-button \
|
||||||
|
--help-label "Exit" \
|
||||||
--menu "Select a radio station" -1 -1 -1 "${menuList[@]}" --stdout)"
|
--menu "Select a radio station" -1 -1 -1 "${menuList[@]}" --stdout)"
|
||||||
menuCode=$?
|
menuCode=$?
|
||||||
if [[ $menuCode -eq 1 ]]; then
|
if [[ $menuCode -eq 2 ]]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
export url
|
||||||
|
|
||||||
if [[ ${menuCode} -eq 3 ]]; then
|
if [[ ${menuCode} -eq 1 ]]; then
|
||||||
|
trap - SIGINT SIGTERM EXIT
|
||||||
|
if ! command -v mkchromecast &> /dev/null ; then
|
||||||
|
echo "Please install mkchromecast to use this functionality."
|
||||||
|
fi
|
||||||
|
mkchromecast --encoder-backend ffmpeg --source-url "$url" --control
|
||||||
|
sleep 2
|
||||||
|
exit 0
|
||||||
|
elif [[ ${menuCode} -eq 3 ]]; then
|
||||||
if ! command -v streamripper &> /dev/null ; then
|
if ! command -v streamripper &> /dev/null ; then
|
||||||
echo "Please install streamripper."
|
echo "Please install streamripper."
|
||||||
exit 1
|
exit 1
|
||||||
|
Loading…
Reference in New Issue
Block a user