From 06a09db3fee550d211002e77d7dda64ccec06e71 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Mon, 26 Dec 2016 12:01:10 -0500 Subject: new commands --- dot/local/bin/amixer-capture.sh | 12 ++++++++++++ dot/local/bin/musopen | 16 ++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100755 dot/local/bin/amixer-capture.sh create mode 100644 dot/local/bin/musopen (limited to 'dot/local') diff --git a/dot/local/bin/amixer-capture.sh b/dot/local/bin/amixer-capture.sh new file mode 100755 index 0000000..0578c72 --- /dev/null +++ b/dot/local/bin/amixer-capture.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +SETME=${1:-100%} + +amixer controls|( + IFS=, + while read a b c _; do + case "${c#name=}" in *Capture*|*Boost*) + amixer cset "$a,$b,$c" "$SETME";; + esac + done +) diff --git a/dot/local/bin/musopen b/dot/local/bin/musopen new file mode 100644 index 0000000..9f3f253 --- /dev/null +++ b/dot/local/bin/musopen @@ -0,0 +1,16 @@ +#!/bin/sh + +CAPTURE= +JSON=$(curl -s https://musopen.org/radio/next/) + +for v in url piece piece_url; do + eval $v='$(printf %s "$JSON" | jq -r .'$v')' +done + +printf '%s (%s)\n' "$piece" "$piece_url" +filename=${piece_url%/}.mp3 +filename=${filename##*/} + +[ "$CAPTURE" ] || filename= + +exec mpv "$url" ${filename+ --stream-capture="$filename"} -- cgit v1.2.3