From 6b9233b9651d5a06dcc2f793282ae5f8f69772b2 Mon Sep 17 00:00:00 2001 From: Anjandev Momi Date: Mon, 17 Aug 2020 01:06:06 -0700 Subject: [PATCH] youtube: keep search history resolves #50 --- scripts/appscripts/sxmo_youtube.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/appscripts/sxmo_youtube.sh b/scripts/appscripts/sxmo_youtube.sh index 89b2edb..f756164 100755 --- a/scripts/appscripts/sxmo_youtube.sh +++ b/scripts/appscripts/sxmo_youtube.sh @@ -1,12 +1,17 @@ #!/usr/bin/env sh +HISTORY_FILE="$XDG_CONFIG_HOME"/sxmo/youtubehistory.tsv + menu() { pidof "$KEYBOARD" || "$KEYBOARD" & + HISTORY="$(tac "$HISTORY_FILE" | nl | sort -uk 2 | sort -k 1 | cut -f 2)" + SEARCHTERMS="$( - echo "Close Menu" | + printf %b "Close Menu\n$HISTORY" | dmenu -p "Yt Search" -c -l 10 -fn Terminus-20 )" pkill "$KEYBOARD" [ "Close Menu" = "$SEARCHTERMS" ] && exit 0 + printf %b "$SEARCHTERMS\n" >> "$HISTORY_FILE" IDIOTRESULTS="$(youtube-cli "$SEARCHTERMS")" FMTRESULTS="$(