3 # forked from https://gitlab.com/uoou/dotfiles/-/tree/master/stow/bin/home/drew/.local/bin/lace
4 # https://raw.githubusercontent.com/frrobert2/lace/main/lace
5 # Shows both how many days ago and date
6 # Modified to work with Debian running Sed 3.7
7 # connectto is a timeout variable in seconds
8 # it is the time lace will wait to connect to a site before it stops the connection
9 # default is 30 seconds you can change it what you want
12 if [ -z "$XDG_CONFIG_HOME" ];then
13 config_place="$HOME/.config/lace"
15 config_place="$XDG_CONFIG_HOME/lace"
19 if [[ "$1" == "nope" ]];then
20 cat $config_place/microblogs.gmi
22 less -RisW $config_place/microblogs.gmi
26 if [[ "$1" == "help" ]] || [[ "$1" == "--help" ]] || [[ "$1" == "-help" ]] || [[ "$1" == "-h" ]];then
28 elif [[ "$1" == "sub" ]];then
29 [[ "$#" -ne 3 ]] && dohelp
30 echo "$3 $2" >> $subsfile && echo "added $2 to subscriptions"
31 elif [[ "$1" == "unsub" ]];then
32 [[ "$#" -ne 2 ]] && dohelp
33 if grep " $2$" $subsfile 1>/dev/null;then
34 sed -i "/ $2$/d" $subsfile &&
35 echo "removed subscription to $2"
37 echo "subscription \"$2\" does not exist"
39 elif [[ "$1" == "subs" ]];then
40 awk '{print $2" ("$1")"}' $subsfile
41 elif [[ "$1" == "update" ]];then
42 curl https://gitlab.com/frrobert2/lace/-/raw/dev/lacedreader > "${BASH_SOURCE[0]}"