Add tee to prepare for links
authorCase Duckworth <acdw@acdw.net>
Sun, 24 May 2020 05:26:02 +0000 (00:26 -0500)
committerCase Duckworth <acdw@acdw.net>
Sun, 24 May 2020 05:26:02 +0000 (00:26 -0500)
bollux

diff --git a/bollux b/bollux
index 7711dd6..7f7459c 100755 (executable)
--- a/bollux
+++ b/bollux
@@ -308,22 +308,15 @@ display() { # display META < DOCUMENT
 
        case "$mime" in
        text/gemini)
-               lfn | typeset_gemini | less -R
-               ;;
-       text/*)
-               lfn
-               # TODO: use less with linking and stuff
-               # less -R -p'^=>' +g
+               lc="/tmp/bollux-currentpage.gmi" # link copy
+               lfn | typeset_gemini | tee "$lc" | less -R ||
+                       cat "$lc" # TODO list out links on success
                # lesskey:
-               # l /=>\n # highlight links
-               # o pipe \n open_url # open the link on the top line
-               # u shell select_url % # shows a selection prompt for all urls (on screen? file?)
-               # Q exit 1  # for one of these, show a selection prompt for urls
-               # q exit 0  # for the other, just quit
-               ###
-               # also look into the prompt, the filename, and input preprocessor
-               # ($LESSOPEN, $LESSCLOSE)
+               # o #> Open a link (quit 1)
+               # q #> Quit (quit 0)
+               # cf. also prompt & filename
                ;;
+       text/*) lfn ;;
        *) download "$URL" ;;
        esac
 }