astro

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.clttr.info/astro.git
Log (Feed) | Files | Refs (Tags) | README | LICENSE

commit 2bb8ee0aae6303533a2204b9ddf808fd267a587b
parent 474e971d5b56fe332e0f71a159fa4ec1a4af4374
Author: blmayer <bleemayer@gmail.com>
Date:   Wed, 14 Jul 2021 18:24:11 -0300

Added home key binding

Diffstat:
MREADME.md | 2+-
Mastro | 26+++++++++++---------------
2 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/README.md b/README.md @@ -30,6 +30,7 @@ no arguments takes you to *gemini.circumlunar.space*: - `b` to go back one page - `o` to open a new URL, you'll be prompted to type it - `r` to reload the page +- `H` to go to the home page - `g` to follow a link in the current page, a link will be displayed, and - `q` to quit @@ -44,7 +45,6 @@ This software is a work in progress and may not work as it is intended to. ### Further works - Bookmarks -- Go to home keybinding - Better history - Colors - Formating diff --git a/astro b/astro @@ -107,6 +107,7 @@ fetch() { 51) echo "Page not found!" >&2 fetch $(parseurl "$prev") + return 0 ;; 52) return 10 @@ -172,9 +173,7 @@ fetch() { # Choose what to do next [ "$debug" ] && echo "pager exit code: $code" case "$code" in - 0) - exit - ;; + 0) exit 0 ;; 49) # Open url printf "Type url: " @@ -182,13 +181,8 @@ fetch() { [ "$debug" ] && echo "New url: $url" >&2 prev="$1://$2:$3/$4" - [ "$debug" ] && echo "prev: $prev" - ;; - 50) - # Refresh - url="$1://$2:$3/$4" - [ "$debug" ] && echo "Refresh: $url" >&2 ;; + 50) url="$1://$2:$3/$4" ;; 51) # Folow link prev="$1://$2:$3/$4" @@ -200,10 +194,8 @@ fetch() { read -r -u 1 i url="$(grep -G "^$i " "$cachedir/links.txt" | cut -d' ' -f2)" ;; - 52) - # Back - url="$prev" - ;; + 52) url="$prev" ;; + 53) url="$(printf "%s://%s:%s/%s" $(parseurl "$homepage"))" ;; esac # Add domain for incomplete links @@ -245,8 +237,12 @@ cachedir="$HOME/.cache/astro" LESSKEY="$HOME/.config/astro/less.keys" # This is the final binary form, to save space, it corresponds to: -# g (49): go to a link, r (50): reload page and o (51): to to a URL -[ -n "$LESSKEY" ] && echo "AE0rR2MUAG8AmDEAcgCYMgBnAJgzAGIAmDQAZQAAdgAAeEVuZA==" | \ +# o (49): to to a URL +# r (50): reload page +# g (51): go to a link +# b (52): go back +# H (53): go to homepage +[ -n "$LESSKEY" ] && echo "AE0rR2MZAG8AmDEAcgCYMgBnAJgzAGIAmDQASACYNQBlAAB2AAB4RW5k" | \ base64 -d > "$LESSKEY" # Configuration step