youtube: keep search history

resolves #50
master
Anjandev Momi 4 years ago committed by Miles Alan
parent 7ec9ca2db1
commit 6b9233b965
  1. 7
      scripts/appscripts/sxmo_youtube.sh

@ -1,12 +1,17 @@
#!/usr/bin/env sh #!/usr/bin/env sh
HISTORY_FILE="$XDG_CONFIG_HOME"/sxmo/youtubehistory.tsv
menu() { menu() {
pidof "$KEYBOARD" || "$KEYBOARD" & pidof "$KEYBOARD" || "$KEYBOARD" &
HISTORY="$(tac "$HISTORY_FILE" | nl | sort -uk 2 | sort -k 1 | cut -f 2)"
SEARCHTERMS="$( SEARCHTERMS="$(
echo "Close Menu" | printf %b "Close Menu\n$HISTORY" |
dmenu -p "Yt Search" -c -l 10 -fn Terminus-20 dmenu -p "Yt Search" -c -l 10 -fn Terminus-20
)" )"
pkill "$KEYBOARD" pkill "$KEYBOARD"
[ "Close Menu" = "$SEARCHTERMS" ] && exit 0 [ "Close Menu" = "$SEARCHTERMS" ] && exit 0
printf %b "$SEARCHTERMS\n" >> "$HISTORY_FILE"
IDIOTRESULTS="$(youtube-cli "$SEARCHTERMS")" IDIOTRESULTS="$(youtube-cli "$SEARCHTERMS")"
FMTRESULTS="$( FMTRESULTS="$(

Loading…
Cancel
Save