use ytfzf history file instead of separate history file
This commit is contained in:
parent
70772b26b6
commit
6cdda28f14
1 changed files with 4 additions and 4 deletions
|
@ -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}"
|
||||
|
||||
|
|
Loading…
Reference in a new issue