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
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="$(

Loading…
Cancel
Save