moved trial versions to alpha branch and moved current version to main
authorfrrobert2 <frrobert@stnectarios.org>
Mon, 19 Apr 2021 02:26:54 +0000 (22:26 -0400)
committerfrrobert2 <frrobert@stnectarios.org>
Mon, 19 Apr 2021 02:26:54 +0000 (22:26 -0400)
README.md
lace [changed mode: 0644->0755]
laceandterm [deleted file]
lacehowlong [deleted file]
lacewithdate [deleted file]

index 1f878a0ca1dcc55c64f67715f7fb6e4a2d570149..36644ebbf532d317928748e7e81bc1a29079f108 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,27 +1,18 @@
 Forked from https://gitlab.com/uoou/dotfiles/-/blob/master/stow/bin/home/drew/.local/bin/lace
 
 Forked from https://gitlab.com/uoou/dotfiles/-/blob/master/stow/bin/home/drew/.local/bin/lace
 
-This version will run on Debian based distros running Sed 3.7
-
 Lace is a small script to interlace Gemini Capsule micro blogs.
 
 Lace is a small script to interlace Gemini Capsule micro blogs.
 
-The original script showed how long ago a entry was posted.  
-https://www.youtube.com/watch?v=RPMLGK8lWX4
-All scripts will run with Sed 3.7 on standard Linux Distros
-
-lace has two time headers.
-How long ago the micropost was sent.
-The date and time the micropost was sent.
+Enhancements made to the original lace with this fork.
 
 
-lacehowlong only has the how long ago time header.
+The original lace would not run on Linux distributions running sed 3.7 or on Termux on Android.
 
 
-lacewithdate only has the date and time header.
+Lace can now run on either a standard Linux distributions running sed 3.7, Termux on android, and UserLAnd on Android.  Sed, date, openssl, curl, less are dependencies that need to be installed.
 
 
-### laceandterm
+The original script showed how long ago a entry was posted. Lace now shows how long ago a post occurred and the date and time of the post. 
 
 
-laceandterm can run on either a standard Linux distro, termux on android, UserLAnd, and possibly other Linux emulations.  Sed, date, openssl, curl, lessqq are dependencies that need to be installed.
+### Favicons
 
 
-laceandterm may show the acual code for a favicon rather than the icon itself depending on the version of GNU less and/or fonts installed.
-If this happens you can either install a font that supports the favicon or comment out the following line in the script.
+Lace may show the actual code for a favicon rather than the icon itself depending on the version of GNU less and/or fonts installed. If this happens you can either install a font that supports the favicon or comment out the following line in the script.
 
 ```
 fav=$(openssl s_client -crlf -quiet -connect "$domain:1965" <<<"gemini://$domain/favicon.txt" 2>/dev/null | sed -e '1d')
 
 ```
 fav=$(openssl s_client -crlf -quiet -connect "$domain:1965" <<<"gemini://$domain/favicon.txt" 2>/dev/null | sed -e '1d')
@@ -32,3 +23,4 @@ Since favicons are not part of the Gemini standard, you may not want favicons to
 ### Post about original script.
 
 https://friendo.monster/posts/a-script-to-interleave-tiny-gemini-logs.html
 ### Post about original script.
 
 https://friendo.monster/posts/a-script-to-interleave-tiny-gemini-logs.html
+
diff --git a/lace b/lace
old mode 100644 (file)
new mode 100755 (executable)
index 2f57350..3a92438
--- a/lace
+++ b/lace
@@ -6,6 +6,7 @@
 # Modified to work with Debian running Sed 3.7
 if [ -z "$XDG_CONFIG_HOME" ];then
        config_place="$HOME/.config/lace"
 # Modified to work with Debian running Sed 3.7
 if [ -z "$XDG_CONFIG_HOME" ];then
        config_place="$HOME/.config/lace"
+[[ ! -d "$HOME/.config" ]] && mkdir -p "$HOME/.config"
 else
        config_place="$XDG_CONFIG_HOME/lace"
 fi
 else
        config_place="$XDG_CONFIG_HOME/lace"
 fi
@@ -16,8 +17,14 @@ red="[31m"
 blue="[34m"
 nc="[m"
 esc=$(echo -e "\033")
 blue="[34m"
 nc="[m"
 esc=$(echo -e "\033")
+if [ ! -d "/tmp" ];then
+[[ ! -d "$HOME/.tmp" ]] && mkdir -p "$HOME/.tmp"
+tmpfile=$(mktemp ~/.tmp/lace.XXXXXX)
+tmpfile2=$(mktemp ~/.tmp/lace.XXXXXX)
+else
 tmpfile=$(mktemp /tmp/lace.XXXXXX)
 tmpfile2=$(mktemp /tmp/lace.XXXXXX)
 tmpfile=$(mktemp /tmp/lace.XXXXXX)
 tmpfile2=$(mktemp /tmp/lace.XXXXXX)
+fi
 function reldate() {
 # stolen from https://unix.stackexchange.com/a/451216
     local SEC_PER_MINUTE=$((60))
 function reldate() {
 # stolen from https://unix.stackexchange.com/a/451216
     local SEC_PER_MINUTE=$((60))
@@ -72,12 +79,12 @@ function timeline() {
                        domain="$url"
                        url="gemini://$url"
                else
                        domain="$url"
                        url="gemini://$url"
                else
-                               domain=$(sed 's/gemini:\/\///' <<< "$url")
+                               domain=$(sed 's#gemini://##' <<< "$url")
                        fi
                        if [[ "$url" != *.*/*.* ]] && [[ $url != */ ]];then
                                url="$url/"
                        fi
                        fi
                        if [[ "$url" != *.*/*.* ]] && [[ $url != */ ]];then
                                url="$url/"
                        fi
-                       domain=$(sed 's/\/.*$//' <<< "$domain")
+                       domain=$(sed 's#/.*$##' <<< "$domain")
                        fav=$(openssl s_client -crlf -quiet -connect "$domain:1965" <<<"gemini://$domain/favicon.txt" 2>/dev/null | sed -e '1d')
                        if [ ! -z "$fav" ];then
                                user="$fav $user"
                        fav=$(openssl s_client -crlf -quiet -connect "$domain:1965" <<<"gemini://$domain/favicon.txt" 2>/dev/null | sed -e '1d')
                        if [ ! -z "$fav" ];then
                                user="$fav $user"
@@ -85,28 +92,30 @@ function timeline() {
                        openssl s_client -crlf -quiet -connect "$domain:1965" <<<"$url" 2>/dev/null | sed -e '1d' | sed -n '/##/,$p' | sed -e "s/^\(## .*\)$/\1\n${esc}$red$user${esc}$nc ($domain)/g" >> $tmpfile
                        [[ ! -z $(sed -n '$p' $tmpfile) ]] && echo "" >> $tmpfile
                done <"$subsfile"
                        openssl s_client -crlf -quiet -connect "$domain:1965" <<<"$url" 2>/dev/null | sed -e '1d' | sed -n '/##/,$p' | sed -e "s/^\(## .*\)$/\1\n${esc}$red$user${esc}$nc ($domain)/g" >> $tmpfile
                        [[ ! -z $(sed -n '$p' $tmpfile) ]] && echo "" >> $tmpfile
                done <"$subsfile"
-               cat $tmpfile | sed -r ':r;/(^|\n)$/!{$!{N;br}};s/\n/\v/g' | sed -rn '/^## .*/p' | sed -e 's/\v/\n/g' | sed -e "s/^## \(.*\)/date -d '\1' +%s/e" | sed -r ':r;/(^|\n)$/!{$!{N;br}};s/\n/\v/g' | sort -r | sed -e 's/\v/\n/g'  > $tmpfile
-
+#              cat $tmpfile | sed -r ':r;/(^|\n)$/!{$!{N;br}};s/\n/\v/g' | sed -rn '/^## .*/p' | sed -e 's/\v/\n/g' | sed -e "s/^## \(.*\)/date -d '\1' +%s/e" | sed -r ':r;/(^|\n)$/!{$!{N;br}};s/\n/\v/g' | sort -r | sed -e 's/\v/\n/g'  > $tmpfile
+               cat $tmpfile | sed -r ':r;/(^|\n)$/!{$!{N;br}};s/\n/\v/g' | sed -rn '/^## .*/p' | sed -e 's/\v/\n/g' | sed -e "s/^## \(.*\)/date -d '\1' +%s/e" | sed -r ':r;/(^|\n)$/!{$!{N;br}};s/\n/\v/g' | sort -r | sed -e 's/\v/\n/g'  > $tmpfile2
+echo -n "" > $tmpfile
 
        # removed segment of code       | sed "s/^\([0-9]\+\)$/{reldate \1 $now_unix;}/e" | sed "s/^\([0-9]* [a-z]* ago\)$/${esc}$blue\1${esc}$nc/g"
 
        while read line; do
        if [[ "$line" =~ ^[0-9]{10,}$ ]]; then
 
        # removed segment of code       | sed "s/^\([0-9]\+\)$/{reldate \1 $now_unix;}/e" | sed "s/^\([0-9]* [a-z]* ago\)$/${esc}$blue\1${esc}$nc/g"
 
        while read line; do
        if [[ "$line" =~ ^[0-9]{10,}$ ]]; then
-               reldate "$line" "$(date +%s)" >> $tmpfile2
+               reldate "$line" "$(date +%s)" >> $tmpfile
                
                
-               echo "$(date -d @$line)" >> $tmpfile2
+               echo "$(date -d @$line)" >> $tmpfile
        else
        else
-          echo "$line" >> $tmpfile2
+          echo "$line" >> $tmpfile
        fi
        fi
-       done<$tmpfile
-
-       cat $tmpfile2 | sed "s/^\([0-9]* [a-z]* ago\)$/${esc}$blue\1${esc}$nc/g" >$tmpfile
-        
+       done<$tmpfile2
+#
+       cat $tmpfile | sed "s/^\([0-9]* [a-z]* ago\)$/${esc}$blue\1${esc}$nc/g" >$tmpfile2
+#        
+sed -i -z -e 's/\[m\n/\[m /g' $tmpfile2
 
                if [[ "$1" == "nope" ]];then
 
                if [[ "$1" == "nope" ]];then
-                       cat $tmpfile && rm -f $tmpfile $tmpfile2
+                       cat $tmpfile2 && rm -f $tmpfile $tmpfile2
                else
                else
-                       less -RisW $tmpfile && rm -f $tmpfile $tmpfile2
+               less -RisW $tmpfile2 && rm -f $tmpfile $tmpfile2
                fi
        }
 
                fi
        }
 
diff --git a/laceandterm b/laceandterm
deleted file mode 100644 (file)
index 80d33f4..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-#!/usr/bin/env bash
-
-# forked from https://gitlab.com/uoou/dotfiles/-/tree/master/stow/bin/home/drew/.local/bin/lace
-# https://raw.githubusercontent.com/frrobert2/lace/main/laceandterm
-# Shows both how many days ago and date
-# Modified to work with Debian running Sed 3.7
-if [ -z "$XDG_CONFIG_HOME" ];then
-       config_place="$HOME/.config/lace"
-[[ ! -d "$HOME/.config" ]] && mkdir -p "$HOME/.config"
-else
-       config_place="$XDG_CONFIG_HOME/lace"
-fi
-[[ ! -d "$config_place" ]] && mkdir -p $config_place
-subsfile="$config_place/subs"
-
-red="[31m"
-blue="[34m"
-nc="[m"
-esc=$(echo -e "\033")
-if [ ! -d "/tmp" ];then
-[[ ! -d "$HOME/.tmp" ]] && mkdir -p "$HOME/.tmp"
-tmpfile=$(mktemp ~/.tmp/lace.XXXXXX)
-tmpfile2=$(mktemp ~/.tmp/lace.XXXXXX)
-else
-tmpfile=$(mktemp /tmp/lace.XXXXXX)
-tmpfile2=$(mktemp /tmp/lace.XXXXXX)
-fi
-function reldate() {
-# stolen from https://unix.stackexchange.com/a/451216
-    local SEC_PER_MINUTE=$((60))
-    local   SEC_PER_HOUR=$((60*60))
-    local    SEC_PER_DAY=$((60*60*24))
-    local  SEC_PER_MONTH=$((60*60*24*30))
-    local   SEC_PER_YEAR=$((60*60*24*365))
-
-    local last_unix="$(date --date="@$1" +%s)"    # convert date to unix timestamp
-       local now_unix="$2"
-    local delta_s=$(( now_unix - last_unix ))
-
-    if (( delta_s <  SEC_PER_MINUTE * 2))
-    then
-        echo ""$((delta_s))" seconds ago"
-    elif (( delta_s <  SEC_PER_HOUR * 2))
-    then
-        echo ""$((delta_s / SEC_PER_MINUTE))" minutes ago"
-    elif (( delta_s <  SEC_PER_DAY * 2))
-    then
-        echo ""$((delta_s / SEC_PER_HOUR))" hours ago"
-    elif (( delta_s <  SEC_PER_MONTH * 2))
-    then
-        echo ""$((delta_s / SEC_PER_DAY))" days ago"
-    elif (( delta_s <  SEC_PER_YEAR * 2))
-    then
-        echo ""$((delta_s / SEC_PER_MONTH))" months ago"
-    else
-        echo ""$((delta_s / SEC_PER_YEAR))" years ago"
-    fi
-}
-#export -f reldate
-
-function dohelp() {
-       echo -e "\nUsage:\n"
-       echo -e "\t$(basename "$0") - read subscriptions\n"
-       echo -e "\t$(basename "$0") nope - read subscriptions without pager\n"
-       echo -e "\t$(basename "$0") subs - list subscriptions\n"
-       echo -e "\t$(basename "$0") sub nickname url - add subscription, e.g.:"
-       echo -e "\t$(basename "$0") sub Drew gemini://friendo.monster/tiny.gmi\n"
-       echo -e "\t$(basename "$0") unsub nickname - remove subscription, e.g.:"
-       echo -e "\t$(basename "$0") unsub Drew\n"
-       echo -e "\t$(basename "$0") update - redownload script to location of current script (might need sudo, depending on location)\n"
-       exit
-}
-
-function timeline() {
-       while read f;do
-               local user=$(awk '{print $2}' <<< "$f")
-               local url=$(awk '{print $1}' <<< "$f")
-               if [[ "$url" != *://* ]];then
-                       domain="$url"
-                       url="gemini://$url"
-               else
-                               domain=$(sed 's#gemini://##' <<< "$url")
-                       fi
-                       if [[ "$url" != *.*/*.* ]] && [[ $url != */ ]];then
-                               url="$url/"
-                       fi
-                       domain=$(sed 's#/.*$##' <<< "$domain")
-                       fav=$(openssl s_client -crlf -quiet -connect "$domain:1965" <<<"gemini://$domain/favicon.txt" 2>/dev/null | sed -e '1d')
-                       if [ ! -z "$fav" ];then
-                               user="$fav $user"
-                       fi
-                       openssl s_client -crlf -quiet -connect "$domain:1965" <<<"$url" 2>/dev/null | sed -e '1d' | sed -n '/##/,$p' | sed -e "s/^\(## .*\)$/\1\n${esc}$red$user${esc}$nc ($domain)/g" >> $tmpfile
-                       [[ ! -z $(sed -n '$p' $tmpfile) ]] && echo "" >> $tmpfile
-               done <"$subsfile"
-#              cat $tmpfile | sed -r ':r;/(^|\n)$/!{$!{N;br}};s/\n/\v/g' | sed -rn '/^## .*/p' | sed -e 's/\v/\n/g' | sed -e "s/^## \(.*\)/date -d '\1' +%s/e" | sed -r ':r;/(^|\n)$/!{$!{N;br}};s/\n/\v/g' | sort -r | sed -e 's/\v/\n/g'  > $tmpfile
-               cat $tmpfile | sed -r ':r;/(^|\n)$/!{$!{N;br}};s/\n/\v/g' | sed -rn '/^## .*/p' | sed -e 's/\v/\n/g' | sed -e "s/^## \(.*\)/date -d '\1' +%s/e" | sed -r ':r;/(^|\n)$/!{$!{N;br}};s/\n/\v/g' | sort -r | sed -e 's/\v/\n/g'  > $tmpfile2
-echo -n "" > $tmpfile
-
-       # removed segment of code       | sed "s/^\([0-9]\+\)$/{reldate \1 $now_unix;}/e" | sed "s/^\([0-9]* [a-z]* ago\)$/${esc}$blue\1${esc}$nc/g"
-
-       while read line; do
-       if [[ "$line" =~ ^[0-9]{10,}$ ]]; then
-               reldate "$line" "$(date +%s)" >> $tmpfile
-               
-               echo "$(date -d @$line)" >> $tmpfile
-       else
-          echo "$line" >> $tmpfile
-       fi
-       done<$tmpfile2
-#
-       cat $tmpfile | sed "s/^\([0-9]* [a-z]* ago\)$/${esc}$blue\1${esc}$nc/g" >$tmpfile2
-#        
-
-               if [[ "$1" == "nope" ]];then
-                       cat $tmpfile2 && rm -f $tmpfile $tmpfile2
-               else
-               less -RisW $tmpfile2 && rm -f $tmpfile $tmpfile2
-               fi
-       }
-
-       if [[ "$1" == "help" ]] || [[ "$1" == "--help" ]] || [[ "$1" == "-help" ]] || [[ "$1" == "-h" ]];then
-               dohelp
-       elif [[ "$1" == "sub" ]];then
-               [[ "$#" -ne 3 ]] && dohelp
-               echo "$3 $2" >> $subsfile && echo "added $2 to subscriptions"
-elif [[ "$1" == "unsub" ]];then
-       [[ "$#" -ne 2 ]] && dohelp
-       if grep " $2$" $subsfile 1>/dev/null;then
-               sed -i "/ $2$/d" $subsfile &&
-               echo "removed subscription to $2"
-       else
-               echo "subscription \"$2\" does not exist"
-       fi
-elif [[ "$1" == "subs" ]];then
-       awk '{print $2" ("$1")"}' $subsfile 
-elif [[ "$1" == "update" ]];then
-       curl https://raw.githubusercontent.com/frrobert2/lace/main/laceandterm > "${BASH_SOURCE[0]}"
-else
-       now_unix="$(date +'%s')"
-       if [[ "$1" == "nope" ]];then
-               timeline nope
-       else
-               timeline
-       fi
-fi
diff --git a/lacehowlong b/lacehowlong
deleted file mode 100644 (file)
index 72486c1..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-#!/usr/bin/env bash
-#Forked from https://gitlab.com/uoou/dotfiles/-/tree/master/stow/bin/home/drew/.local/bin/lace 
-# Modified to work on Debian Distros running Sed 3.7
-# https://github.com/frrobert2/lace/blob/main/lacehowlong
-
-if [ -z "$XDG_CONFIG_HOME" ];then
-       config_place="$HOME/.config/lace"
-else
-       config_place="$XDG_CONFIG_HOME/lace"
-fi
-[[ ! -d "$config_place" ]] && mkdir -p $config_place
-subsfile="$config_place/subs"
-
-red="[31m"
-blue="[34m"
-nc="[m"
-esc=$(echo -e "\033")
-tmpfile=$(mktemp /tmp/lace.XXXXXX)
-tmpfile2=$(mktemp /tmp/lace.XXXXXX)
-function reldate() {
-# stolen from https://unix.stackexchange.com/a/451216
-    local SEC_PER_MINUTE=$((60))
-    local   SEC_PER_HOUR=$((60*60))
-    local    SEC_PER_DAY=$((60*60*24))
-    local  SEC_PER_MONTH=$((60*60*24*30))
-    local   SEC_PER_YEAR=$((60*60*24*365))
-
-    local last_unix="$(date --date="@$1" +%s)"    # convert date to unix timestamp
-       local now_unix="$2"
-    local delta_s=$(( now_unix - last_unix ))
-
-    if (( delta_s <  SEC_PER_MINUTE * 2))
-    then
-        echo ""$((delta_s))" seconds ago"
-    elif (( delta_s <  SEC_PER_HOUR * 2))
-    then
-        echo ""$((delta_s / SEC_PER_MINUTE))" minutes ago"
-    elif (( delta_s <  SEC_PER_DAY * 2))
-    then
-        echo ""$((delta_s / SEC_PER_HOUR))" hours ago"
-    elif (( delta_s <  SEC_PER_MONTH * 2))
-    then
-        echo ""$((delta_s / SEC_PER_DAY))" days ago"
-    elif (( delta_s <  SEC_PER_YEAR * 2))
-    then
-        echo ""$((delta_s / SEC_PER_MONTH))" months ago"
-    else
-        echo ""$((delta_s / SEC_PER_YEAR))" years ago"
-    fi
-}
-#export -f reldate
-
-function dohelp() {
-       echo -e "\nUsage:\n"
-       echo -e "\t$(basename "$0") - read subscriptions\n"
-       echo -e "\t$(basename "$0") nope - read subscriptions without pager\n"
-       echo -e "\t$(basename "$0") subs - list subscriptions\n"
-       echo -e "\t$(basename "$0") sub nickname url - add subscription, e.g.:"
-       echo -e "\t$(basename "$0") sub Drew gemini://friendo.monster/tiny.gmi\n"
-       echo -e "\t$(basename "$0") unsub nickname - remove subscription, e.g.:"
-       echo -e "\t$(basename "$0") unsub Drew\n"
-       echo -e "\t$(basename "$0") update - redownload script to location of current script (might need sudo, depending on location)\n"
-       exit
-}
-
-function timeline() {
-       while read f;do
-               local user=$(awk '{print $2}' <<< "$f")
-               local url=$(awk '{print $1}' <<< "$f")
-               if [[ "$url" != *://* ]];then
-                       domain="$url"
-                       url="gemini://$url"
-               else
-                               domain=$(sed 's/gemini:\/\///' <<< "$url")
-                       fi
-                       if [[ "$url" != *.*/*.* ]] && [[ $url != */ ]];then
-                               url="$url/"
-                       fi
-                       domain=$(sed 's/\/.*$//' <<< "$domain")
-                       fav=$(openssl s_client -crlf -quiet -connect "$domain:1965" <<<"gemini://$domain/favicon.txt" 2>/dev/null | sed -e '1d')
-                       if [ ! -z "$fav" ];then
-                               user="$fav $user"
-                       fi
-                       openssl s_client -crlf -quiet -connect "$domain:1965" <<<"$url" 2>/dev/null | sed -e '1d' | sed -n '/##/,$p' | sed -e "s/^\(## .*\)$/\1\n${esc}$red$user${esc}$nc ($domain)/g" >> $tmpfile
-                       [[ ! -z $(sed -n '$p' $tmpfile) ]] && echo "" >> $tmpfile
-               done <"$subsfile"
-               cat $tmpfile | sed -r ':r;/(^|\n)$/!{$!{N;br}};s/\n/\v/g' | sed -rn '/^## .*/p' | sed -e 's/\v/\n/g' | sed -e "s/^## \(.*\)/date -d '\1' +%s/e" | sed -r ':r;/(^|\n)$/!{$!{N;br}};s/\n/\v/g' | sort -r | sed -e 's/\v/\n/g'  > $tmpfile
-
-
-       # removed segment of code       | sed "s/^\([0-9]\+\)$/{reldate \1 $now_unix;}/e" | sed "s/^\([0-9]* [a-z]* ago\)$/${esc}$blue\1${esc}$nc/g"
-
-       while read line; do
-       if [[ "$line" =~ ^[0-9]{10,}$ ]]; then
-               reldate "$line" "$(date +%s)" >> $tmpfile2
-       else
-          echo "$line" >> $tmpfile2
-       fi
-       done<$tmpfile
-
-       cat $tmpfile2 | sed "s/^\([0-9]* [a-z]* ago\)$/${esc}$blue\1${esc}$nc/g" >$tmpfile
-
-
-
-               if [[ "$1" == "nope" ]];then
-                       cat $tmpfile && rm -f $tmpfile $tmpfile2
-               else
-                       less -RisW $tmpfile && rm -f $tmpfile $tmpfile2
-               fi
-       }
-
-       if [[ "$1" == "help" ]] || [[ "$1" == "--help" ]] || [[ "$1" == "-help" ]] || [[ "$1" == "-h" ]];then
-               dohelp
-       elif [[ "$1" == "sub" ]];then
-               [[ "$#" -ne 3 ]] && dohelp
-               echo "$3 $2" >> $subsfile && echo "added $2 to subscriptions"
-elif [[ "$1" == "unsub" ]];then
-       [[ "$#" -ne 2 ]] && dohelp
-       if grep " $2$" $subsfile 1>/dev/null;then
-               sed -i "/ $2$/d" $subsfile &&
-               echo "removed subscription to $2"
-       else
-               echo "subscription \"$2\" does not exist"
-       fi
-elif [[ "$1" == "subs" ]];then
-       awk '{print $2" ("$1")"}' $subsfile 
-elif [[ "$1" == "update" ]];then
-       curl https://raw.githubusercontent.com/frrobert2/lace/main/lacehowlong > "${BASH_SOURCE[0]}"
-else
-       now_unix="$(date +'%s')"
-       if [[ "$1" == "nope" ]];then
-               timeline nope
-       else
-               timeline
-       fi
-fi
diff --git a/lacewithdate b/lacewithdate
deleted file mode 100644 (file)
index 3514c2d..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/usr/bin/env bash
-#Forked from https://gitlab.com/uoou/dotfiles/-/tree/master/stow/bin/home/drew/.local/bin/lace 
-# Modified to show date rather than how many days ago by frrobert2
-# https://github.com/frrobert2/lace/blob/main/lacewithdate
-if [ -z "$XDG_CONFIG_HOME" ];then
-       config_place="$HOME/.config/lace"
-else
-       config_place="$XDG_CONFIG_HOME/lace"
-fi
-[[ ! -d "$config_place" ]] && mkdir -p $config_place
-subsfile="$config_place/subs"
-
-red="[31m"
-blue="[34m"
-nc="[m"
-esc=$(echo -e "\033")
-tmpfile=$(mktemp /tmp/lace.XXXXXX)
-
-function dohelp() {
-       echo -e "\nUsage:\n"
-       echo -e "\t$(basename "$0") - read subscriptions\n"
-       echo -e "\t$(basename "$0") nope - read subscriptions without pager\n"
-       echo -e "\t$(basename "$0") subs - list subscriptions\n"
-       echo -e "\t$(basename "$0") sub nickname url - add subscription, e.g.:"
-       echo -e "\t$(basename "$0") sub Drew gemini://friendo.monster/tiny.gmi\n"
-       echo -e "\t$(basename "$0") unsub nickname - remove subscription, e.g.:"
-       echo -e "\t$(basename "$0") unsub Drew\n"
-       echo -e "\t$(basename "$0") update - redownload script to location of current script (might need sudo, depending on location)\n"
-       exit
-}
-
-function timeline() {
-       while read f;do
-               local user=$(awk '{print $2}' <<< "$f")
-               local url=$(awk '{print $1}' <<< "$f")
-               if [[ "$url" != *://* ]];then
-                       domain="$url"
-                       url="gemini://$url"
-               else
-                       domain=$(sed 's/gemini:\/\///' <<< "$url")
-               fi
-               if [[ "$url" != *.*/*.* ]] && [[ $url != */ ]];then
-                       url="$url/"
-               fi
-               domain=$(sed 's/\/.*$//' <<< "$domain")
-               fav=$(openssl s_client -crlf -quiet -connect "$domain:1965" <<<"gemini://$domain/favicon.txt" 2>/dev/null | sed -e '1d')
-               if [ ! -z "$fav" ];then
-                       user="$fav $user"
-               fi
-               openssl s_client -crlf -quiet -connect "$domain:1965" <<<"$url" 2>/dev/null | sed -e '1d' | sed -n '/##/,$p' | sed -e "s/^\(## .*\)$/\1\n${esc}$red$user${esc}$nc ($domain)/g" >> $tmpfile
-               [[ ! -z $(sed -n '$p' $tmpfile) ]] && echo "" >> $tmpfile
-       done <"$subsfile"
-       cat $tmpfile | sed -r ':r;/(^|\n)$/!{$!{N;br}};s/\n/\v/g' | sed -rn '/^## .*/p' | sed -e 's/\v/\n/g' | sed -e "s/^## \(.*\)/date -d '\1' +%s/e" | sed -r ':r;/(^|\n)$/!{$!{N;br}};s/\n/\v/g' | sort -r | sed -e 's/\v/\n/g'  > $tmpfile
-
-       sed -i "s/\(^[0-9]\{8,\}$\)/date -d @\1/e" $tmpfile
-       if [[ "$1" == "nope" ]];then
-               cat $tmpfile && rm -f $tmpfile
-       else
-               less -RisW $tmpfile && rm -f $tmpfile
-       fi
-}
-
-if [[ "$1" == "help" ]] || [[ "$1" == "--help" ]] || [[ "$1" == "-help" ]] || [[ "$1" == "-h" ]];then
-       dohelp
-elif [[ "$1" == "sub" ]];then
-       [[ "$#" -ne 3 ]] && dohelp
-       echo "$3 $2" >> $subsfile && echo "added $2 to subscriptions"
-elif [[ "$1" == "unsub" ]];then
-       [[ "$#" -ne 2 ]] && dohelp
-       if grep " $2$" $subsfile 1>/dev/null;then
-               sed -i "/ $2$/d" $subsfile &&
-               echo "removed subscription to $2"
-       else
-               echo "subscription \"$2\" does not exist"
-       fi
-elif [[ "$1" == "subs" ]];then
-       awk '{print $2" ("$1")"}' $subsfile 
-elif [[ "$1" == "update" ]];then
-       curl https://raw.githubusercontent.com/frrobert2/lace/main/lacewithdate > "${BASH_SOURCE[0]}"
-else
-       now_unix="$(date +'%s')"
-       if [[ "$1" == "nope" ]];then
-               timeline nope
-       else
-               timeline
-       fi
-fi