From 6cdda28f14770c7f7bb9b06dea896126b9197237 Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Sun, 27 Aug 2023 19:08:08 +0530 Subject: [PATCH] use ytfzf history file instead of separate history file --- packages/scripts/youtube.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/scripts/youtube.sh b/packages/scripts/youtube.sh index af828f7..26262cd 100755 --- a/packages/scripts/youtube.sh +++ b/packages/scripts/youtube.sh @@ -3,14 +3,14 @@ set -eu XDG_CACHE_HOME=${XDG_CACHE_HOME:-} if [ -n "$XDG_CACHE_HOME" ] ; then - HISTORY_FILE="$XDG_CACHE_HOME/youtube_history" + HISTORY_FILE="$XDG_CACHE_HOME/ytfzf/search_hist" else - HISTORY_FILE="$HOME/.cache/youtube_history" + HISTORY_FILE="$HOME/.cache/ytfzf/search_hist" fi if [ ! -e "$HISTORY_FILE" ] ; then touch "$HISTORY_FILE" fi -SEARCH_TERM="$(rofi -dmenu -p "Search Youtube:" < "$HISTORY_FILE")" -echo "$SEARCH_TERM" >> $HISTORY_FILE +HISTORY="$(awk -F' ' '{$1="";$2="";$3="";print $0}' $HISTORY_FILE | sed 's/^\s*//g' | uniq)" +SEARCH_TERM="$(echo "$HISTORY" | rofi -dmenu -p "Search Youtube:")" kitty --class=ytfzf --title "YouTube Search: ${SEARCH_TERM}" -- ytfzf -f -tT kitty --async-thumbnails "${SEARCH_TERM}"