diff options
Diffstat (limited to 'dot')
-rwxr-xr-x | dot/local/bin/amixer-capture.sh | 12 | ||||
-rw-r--r-- | dot/local/bin/musopen | 16 |
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 | |||
3 | SETME=${1:-100%} | ||
4 | |||
5 | amixer 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 | |||
3 | CAPTURE= | ||
4 | JSON=$(curl -s https://musopen.org/radio/next/) | ||
5 | |||
6 | for v in url piece piece_url; do | ||
7 | eval $v='$(printf %s "$JSON" | jq -r .'$v')' | ||
8 | done | ||
9 | |||
10 | printf '%s (%s)\n' "$piece" "$piece_url" | ||
11 | filename=${piece_url%/}.mp3 | ||
12 | filename=${filename##*/} | ||
13 | |||
14 | [ "$CAPTURE" ] || filename= | ||
15 | |||
16 | exec mpv "$url" ${filename+ --stream-capture="$filename"} | ||