summaryrefslogtreecommitdiff
path: root/dot/local
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2016-12-26 12:01:10 -0500
committerAndrew Cady <d@jerkface.net>2016-12-26 12:01:10 -0500
commit06a09db3fee550d211002e77d7dda64ccec06e71 (patch)
tree9614b46b43a27eb2072858deac97d933ddb78169 /dot/local
parent817db44134697e1d8647305eaedc6253a76c96af (diff)
new commands
Diffstat (limited to 'dot/local')
-rwxr-xr-xdot/local/bin/amixer-capture.sh12
-rw-r--r--dot/local/bin/musopen16
2 files changed, 28 insertions, 0 deletions
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 @@
1#!/bin/sh
2
3SETME=${1:-100%}
4
5amixer controls|(
6 IFS=,
7 while read a b c _; do
8 case "${c#name=}" in *Capture*|*Boost*)
9 amixer cset "$a,$b,$c" "$SETME";;
10 esac
11 done
12)
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 @@
1#!/bin/sh
2
3CAPTURE=
4JSON=$(curl -s https://musopen.org/radio/next/)
5
6for v in url piece piece_url; do
7 eval $v='$(printf %s "$JSON" | jq -r .'$v')'
8done
9
10printf '%s (%s)\n' "$piece" "$piece_url"
11filename=${piece_url%/}.mp3
12filename=${filename##*/}
13
14[ "$CAPTURE" ] || filename=
15
16exec mpv "$url" ${filename+ --stream-capture="$filename"}