remove deprecated $PLUMBER, use exec mpv
This commit is contained in:
9
subs
9
subs
@@ -12,7 +12,6 @@
|
|||||||
# -/-/-/-/- Settings -/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/
|
# -/-/-/-/- Settings -/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/
|
||||||
: "${SUBS_FILE:=~/files/subs.txt}"
|
: "${SUBS_FILE:=~/files/subs.txt}"
|
||||||
: "${SUBS_MENU_PROG:='dmenu -p Subs:'}"
|
: "${SUBS_MENU_PROG:='dmenu -p Subs:'}"
|
||||||
: "${PLUMBER:=head}"
|
|
||||||
: "${SUBS:=${XDG_CACHE_HOME:-~/.cache}/subs}"
|
: "${SUBS:=${XDG_CACHE_HOME:-~/.cache}/subs}"
|
||||||
: "${SUBS_LINKS:=$SUBS/links}"
|
: "${SUBS_LINKS:=$SUBS/links}"
|
||||||
: "${SUBS_CACHE:=$SUBS/cache}"
|
: "${SUBS_CACHE:=$SUBS/cache}"
|
||||||
@@ -158,7 +157,7 @@ cat_subs() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Split the concatenated lines into entities, send to menu program.
|
# Split the concatenated lines into entities, send to menu program.
|
||||||
# Finally, pipe this result to the ${PLUMBER}.
|
# Finally, play the result with mpv.
|
||||||
get_sel() {
|
get_sel() {
|
||||||
sel=$(cat_subs | $SUBS_MENU_PROG)
|
sel=$(cat_subs | $SUBS_MENU_PROG)
|
||||||
|
|
||||||
@@ -171,8 +170,12 @@ get_sel() {
|
|||||||
case $line in
|
case $line in
|
||||||
*"$SEP$title$SEP"*)
|
*"$SEP$title$SEP"*)
|
||||||
url=${line##*$SEP}
|
url=${line##*$SEP}
|
||||||
|
if [ "$url" ] ; then
|
||||||
printf 'playing: %s\n' "$url"
|
printf 'playing: %s\n' "$url"
|
||||||
printf '%s\n' "$url" | $PLUMBER
|
# Play the selection.
|
||||||
|
# shellcheck disable=2086
|
||||||
|
exec mpv $MPV_OPTS "$url"
|
||||||
|
fi
|
||||||
break
|
break
|
||||||
esac
|
esac
|
||||||
done <"$SUBS_CACHE/$chan"
|
done <"$SUBS_CACHE/$chan"
|
||||||
|
|||||||
Reference in New Issue
Block a user