bin: music automations
This commit is contained in:
parent
4091540c6a
commit
620c68f35f
|
@ -3,6 +3,6 @@
|
|||
# depends: fzy/fzf-tmux mpc
|
||||
song_position=$(mpc -f "%position%) %artist% - %title%" playlist |
|
||||
#fzy --query="$1" |
|
||||
fzf-tmux --query="$1" --reverse --select-1 --exit-0 |
|
||||
fzf-tmux --query="$1" --reverse --exit-0 |
|
||||
sed -n 's/^\([0-9]\+\)).*/\1/p')
|
||||
test -n "$song_position" && mpc play $song_position
|
||||
|
|
|
@ -4,15 +4,16 @@
|
|||
# env: MUSIC
|
||||
# args: either a playlist file name, or a list of terms which all have to match
|
||||
# TODO fails on "Alchemy"
|
||||
# TODO implement tags
|
||||
# TODO implement finding by tags
|
||||
PLAYLISTS="${PLAYLISTS:-$MUSIC/Playlists}"
|
||||
mpc -q clear
|
||||
if test -z "$1"
|
||||
then mp -q "$PLAYLISTS/focus.m3u"
|
||||
else
|
||||
set -o noglob
|
||||
(find -L $PLAYLISTS -iname "focus-$1.m3u" -print0 | grep --null-data . ||
|
||||
find -L $PLAYLISTS -iname "$1.m3u*" -print0 | grep --null-data . ||
|
||||
find -L $MUSIC $(echo "$@" | sed 's/\w\+/-iname *\0* /g') -prune -exec find {} -size +1M -type f -not -iregex ".*.\(jpe?g\|png\)" -print0 \; ) |
|
||||
find -L $MUSIC $(echo "$@" | sed "s/\w\+/-iname *\0* /g") -prune -exec find {} -size +1M -type f -not -iregex ".*.\(jpe?g\|png\)" -print0 \; ) |
|
||||
xargs -0 mp -q
|
||||
fi
|
||||
if test $(mpc playlist | wc -l) -gt 1; then
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
#!/bin/sh
|
||||
opusenc "$@" "${1%.*}.opus"
|
||||
# Convert given file to opus, requires opus-tools or ffmpeg
|
||||
opusenc "$@" "${1%.*}.opus" ||
|
||||
ffmpeg -i "$@" "${1%.*}.opus"
|
||||
|
|
Loading…
Reference in New Issue