bin: little script corrections
This commit is contained in:
parent
93628b4a86
commit
7a4eba60cd
|
@ -2,6 +2,7 @@ $XDG_CONFIG_HOME/yadm
|
||||||
$XDG_CONFIG_HOME/doom
|
$XDG_CONFIG_HOME/doom
|
||||||
$XDG_CONFIG_HOME/git
|
$XDG_CONFIG_HOME/git
|
||||||
$XDG_CONFIG_HOME/nvim
|
$XDG_CONFIG_HOME/nvim
|
||||||
|
$XDG_CONFIG_HOME/espanso
|
||||||
$XDG_CONFIG_HOME/zsh/completion
|
$XDG_CONFIG_HOME/zsh/completion
|
||||||
$CONFIG_SHELLS
|
$CONFIG_SHELLS
|
||||||
$HOME/.local/bin/scripts
|
$HOME/.local/bin/scripts
|
||||||
|
|
|
@ -18,4 +18,4 @@ ${run:-sudo --preserve-env=BORG_REPO BORG_PASSPHRASE="$($BORG_PASSCOMMAND)" borg
|
||||||
$(echo $DIRS_IGNORE_SAFE -x 'software-challenge/**/build' -x state/emacs -x state/go -x .local/lib -x .cpan -x *cache |
|
$(echo $DIRS_IGNORE_SAFE -x 'software-challenge/**/build' -x state/emacs -x state/go -x .local/lib -x .cpan -x *cache |
|
||||||
sed 's|-x \([^ ]\+\)|-e sh:**/\1|g') \
|
sed 's|-x \([^ ]\+\)|-e sh:**/\1|g') \
|
||||||
"$name" $(test $# -eq 0 && echo etc home root || test $# -eq 1 && echo $1) "${@:2}" 2>&1
|
"$name" $(test $# -eq 0 && echo etc home root || test $# -eq 1 && echo $1) "${@:2}" 2>&1
|
||||||
sudo chown -R $USER:$USER "$BORG_REPO"
|
test -n "$run" || sudo chown -R $USER:$USER "$BORG_REPO"
|
||||||
|
|
|
@ -9,7 +9,7 @@ then mp -q "$PLAYLISTS/focus.m3u"
|
||||||
else
|
else
|
||||||
(find -L $PLAYLISTS -iname "focus-$1.m3u" -print0 | grep --null-data . ||
|
(find -L $PLAYLISTS -iname "focus-$1.m3u" -print0 | grep --null-data . ||
|
||||||
find -L $PLAYLISTS -iname "$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
|
xargs -0 mp -q
|
||||||
fi
|
fi
|
||||||
if test $(mpc playlist | wc -l) -gt 1; then
|
if test $(mpc playlist | wc -l) -gt 1; then
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh
|
||||||
# [M]edia [P]lay
|
# [M]edia [P]lay
|
||||||
# Play given files on mpd, playing external files through symlinking and recursively resolving playlists
|
# Play given files on mpd, playing external files through symlinking and recursively resolving playlists
|
||||||
# depends: xargs realpath mpc
|
# depends: xargs realpath mpc
|
||||||
|
@ -11,9 +11,10 @@ then shift
|
||||||
test "$1" = "-v" && verbose=-v && set -x && shift
|
test "$1" = "-v" && verbose=-v && set -x && shift
|
||||||
# TODO this is sooo slow...
|
# TODO this is sooo slow...
|
||||||
for arg
|
for arg
|
||||||
do filepath="$({ find "$(dirname -- "$arg")" -maxdepth 1 -name "$(basename -- "$arg")*" -exec realpath {} + ||
|
do
|
||||||
find "$MUSIC/$(dirname -- "$arg")" "$MUSIC/Playlists/$(dirname -- "$arg")" -maxdepth 1 \
|
filepath="$({ find "$(dirname -- "$arg")" -maxdepth 1 -name "$(basename -- "$arg")*" -exec realpath {} + ||
|
||||||
-name "$(basename -- "$arg")*" -exec realpath {} +; } 2>/dev/null)"
|
find "$MUSIC/$(dirname -- "$arg")" "$MUSIC/Playlists/$(dirname -- "$arg")" -maxdepth 1 \
|
||||||
|
-name "$(basename -- "$arg")*" -exec realpath {} +; } 2>/dev/null)"
|
||||||
test -n "$verbose" && echo "Scanning path '$filepath' $(
|
test -n "$verbose" && echo "Scanning path '$filepath' $(
|
||||||
test "$arg" != "$filepath" && echo "from '$arg' ")(MUSIC: '$MUSIC', PWD: '$PWD')" >&2
|
test "$arg" != "$filepath" && echo "from '$arg' ")(MUSIC: '$MUSIC', PWD: '$PWD')" >&2
|
||||||
test $(printf "$filepath" | wc -l) -gt 0 && printf "$filepath" | xargs --delim='\n' "$0" -r $verbose && continue
|
test $(printf "$filepath" | wc -l) -gt 0 && printf "$filepath" | xargs --delim='\n' "$0" -r $verbose && continue
|
||||||
|
|
Loading…
Reference in New Issue