From 28ea0e3cbe1c0f980a05d6fb13a428bcab2ea1c5 Mon Sep 17 00:00:00 2001 From: Vikas Kushwaha Date: Fri, 13 Jun 2025 08:37:31 +0530 Subject: neovim updates --- .local/bin/web/yth | 19 +++++++++++++++++++ .local/bin/web/ytv | 13 +++++++++++++ 2 files changed, 32 insertions(+) create mode 100755 .local/bin/web/yth (limited to '.local/bin/web') diff --git a/.local/bin/web/yth b/.local/bin/web/yth new file mode 100755 index 0000000..26cbe91 --- /dev/null +++ b/.local/bin/web/yth @@ -0,0 +1,19 @@ +#!/bin/sh + +[ -n "$YT_HISTFILE" ] || + export YT_HISTFILE="${XDG_STATE_HOME:-$HOME/.local/state}/yt_history.tsv" + +menu() { + case "$1" in + dmenu) tac "$YT_HISTFILE" | dmenu -l 30 ;; + *) + bat --color=always --language=tsv --style=plain "$YT_HISTFILE" | + fzf --ansi --tac \ + --delimiter '\t' --with-nth 2,3 \ + --header-first --header "YT History" \ + --preview="echo {1}" --preview-window="up,1" \ + --bind 'ctrl-y:execute-silent(printf "%s\n" {1} | xsel --clipboard)' ;; + esac +} + + menu "$@" | sed -E "s/\t.*\t.*$//" diff --git a/.local/bin/web/ytv b/.local/bin/web/ytv index c6e9eec..697c86f 100755 --- a/.local/bin/web/ytv +++ b/.local/bin/web/ytv @@ -1,3 +1,16 @@ #!/bin/sh +case "$(echo "$PWD" | tr '[:upper:]' '[:lower:]')" in + *videos*|*movies*|*series*) ;; + *) + printf "Non standard path for video download, continue? [Y/n] " >&2 + + read -r arg + case "$arg" in + n|N) exit ;; + esac + echo + ;; +esac + yt-dlp "$@" --config ~/.config/yt-dlp/videos.conf -- cgit v1.2.3