#!/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/lace # Shows both how many days ago and date # Modified to work with Debian running Sed 3.7 # connectto is a timeout variable in seconds # it is the time lace will wait to connect to a site before it stops the connection # default is 30 seconds you can change it what you want connectto=30 set -o pipefail if [ -z "$XDG_CONFIG_HOME" ];then config_place="$HOME/.config/lace" else config_place="$XDG_CONFIG_HOME/lace" fi if [[ "$1" == "nope" ]];then cat $config_place/microblogs.gmi else less -RisW $config_place/microblogs.gmi 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://gitlab.com/frrobert2/lace/-/raw/dev/lacedreader > "${BASH_SOURCE[0]}" fi