Created
November 3, 2019 02:24
-
-
Save ovelny/893fb617fbeeaad45159041edd210847 to your computer and use it in GitHub Desktop.
Simple script to play radio stations I like.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
IFS=$'\n\t' | |
# This script is meant to play some favorite radio stations | |
# in background easily, thanks to cvlc. The .pls URLs might | |
# become outdated with time, but hey... fingers crossed. | |
# All listed URLs are the best stream quality that I could find. | |
if [[ "$#" -eq 0 ]]; then | |
cat <<END | |
Choose one station to run in background with cvlc. | |
Available streams | |
--------- | |
soma fm stations | |
--------- | |
groove-salad | |
groove-salad-classic | |
def-con | |
deep-space-one | |
drone-zone | |
the-trip | |
space-station-soma | |
rekt fm | |
--------- | |
rekt | |
nightride | |
rektory | |
rektify | |
END | |
exit 0 | |
fi | |
if [[ "$#" -gt 1 ]]; then | |
echo Please pick only one station. | |
exit 1 | |
fi | |
case "$1" in | |
"groove-salad") | |
cvlc https://somafm.com/groovesalad256.pls & | |
;; | |
"groove-salad-classic") | |
cvlc https://somafm.com/gsclassic.pls & | |
;; | |
"def-con") | |
cvlc https://somafm.com/defcon256.pls & | |
;; | |
"deep-space-one") | |
cvlc https://somafm.com/deepspaceone.pls & | |
;; | |
"drone-zone") | |
cvlc https://somafm.com/dronezone256.pls & | |
;; | |
"the-trip") | |
cvlc https://somafm.com/thetrip.pls & | |
;; | |
"space-station-soma") | |
cvlc https://somafm.com/spacestation.pls & | |
;; | |
"rekt") | |
cvlc https://rekt.fm/stream/rekt.m4a & | |
;; | |
"nightride") | |
cvlc https://rekt.fm/stream/nightride.m4a & | |
;; | |
"rektory") | |
cvlc https://rekt.fm/stream/rektory.m4a & | |
;; | |
"rektify") | |
cvlc https://rekt.fm/stream/rektify.m4a & | |
;; | |
*) | |
echo Station does not exist. | |
echo Run this script with no parameters to get the full list. | |
exit 1 | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment