Re-adding history to dmenu_qutebrowser userscript

As there is not a file called history to cat from in $QUTE_DATA_DIR, but instead a sqlite file called history.sqlite.
Thus I changed this for sqlite3 and an inline query on the history table, extracting distinct urls. And with fprint and cat piping them into dmenu,
the rest works as always.
This commit is contained in:
Asger Geel Weirsøe 2020-10-22 13:50:03 +02:00 committed by GitHub
parent a201595f24
commit c5d5197b01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -38,11 +38,13 @@
# (This is unnecessarily long. I use this rarely, feel free to make this script accept parameters.)
#
[ -z "$QUTE_URL" ] && QUTE_URL='http://google.com'
url=$(echo "$QUTE_URL" | cat - "$QUTE_CONFIG_DIR/quickmarks" "$QUTE_DATA_DIR/history" | dmenu -l 15 -p qutebrowser)
[ -z "$QUTE_URL" ] && QUTE_URL='https://duckduckgo.com'
url=$(printf "%s\n%s" "$QUTE_URL" "$(sqlite3 "$QUTE_DATA_DIR/history.sqlite" 'select url from CompletionHistory')" | cat "$QUTE_CONFIG_DIR/quickmarks" - | dmenu -l 15 -p qutebrowser)
url=$(echo "$url" | sed -E 's/[^ ]+ +//g' | grep -E "https?:" || echo "$url")
[ -z "${url// }" ] && exit
echo "open $url" >> "$QUTE_FIFO" || qutebrowser "$url"