From c4918d16dac547fe71f351eab41a2fb8ff8e8b31 Mon Sep 17 00:00:00 2001 From: emma Date: Sun, 19 Nov 2023 09:33:13 -0700 Subject: [PATCH] added configurable picker --- yt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/yt b/yt index f743c44..4f8bcd7 100755 --- a/yt +++ b/yt @@ -103,7 +103,7 @@ pick() { # Pick a video to play from a list of videos shift done - chosen="$(printf '%s\n' "$list" | fzf | sed -e 's/.*\[//g' -e 's/\]//g')" + chosen="$(printf '%s\n' "$list" | $YTPICK | sed -e 's/.*\[//g' -e 's/\]//g')" test -n "$chosen" && mpv "$chosen" } @@ -172,13 +172,17 @@ cachefile="$XDG_CACHE_HOME/yt.cache" FMT='%(title)s – %(channel)s (%(duration>%H:%M:%S)s) [%(webpage_url)s]' WBAPI='https://archive.org/wayback/available?url=' +if test -z "$YTPICK"; then + printf "%s: \$YTPICK unset." 1>&2 + exit 78 # sysexits.h(3) EX_CONFIG +fi + if test -n "$DEBUG"; then set -x fi for dep in \ curl \ - fzf \ jq \ mpv \ yt-dlp