# requires dateutils (https://www.fresse.org/dateutils/). 'unset -v LDFLAGS CXXFLAGS CFLAGS CPPFLAGS' required for compilation due to include folders and -Qunused-arguments
# inefficient, ugly, slow mess
nojack-tracker() {
    ddifffmat() { date -u -d @$(date "+%s" -d "$@") +"%Y-%m-%dT%H:%M:%S" ; }
    njhll() { if [ -a ~/nojack-history ] ; then tail -n 1 ~/nojack-history | tr -d '\n' ; fi ; }
    suffixeddate() { echo "$(< ~/nojack-date)" | xargs bash -c 'echo "${@:1:2}" "$3""$(case $3 in 1|21|31) echo "st";; 2|22) echo "nd";; 3|23) echo "rd";; *) echo "th";; esac)", "$4" @ "${@:5}"' argv0 ; }
    nojackdiff() { datediff "$(ddifffmat "$(< ~/nojack-date)")" "$(if [ "$1" == "now" ]; then echo -n "$1" ; else ddifffmat "$@" ; fi)" -f '%d %H %M' | xargs bash -c 'echo -n "${1#-} $(if [ "$1" -eq "1" ]; then echo -n "day" ; else echo -n "days" ; fi), $2 $(if [ "$2" -eq "1" ]; then echo -n "hour" ; else echo -n "hours" ; fi), $3 $(if [ "$3" -eq "1" ]; then echo -n "minute" ; else echo -n "minutes" ; fi)"' argv0 ; }
    if [ -z "$1" ]; then
        echo "Last served Satan, the NWO, perversion, degeneracy, sexual deviance, and dumb, repulsive, revolting, disgusting, filthy, evil cunt whores that are disgusted by you, that mock you, that hate you, that revel in the power they wield over you:"
        echo -n "$(nojackdiff now) ago"
        echo " ($(suffixeddate))" ;
    elif [ "$1" == "-set" ] && [ $# -gt 1 ]; then
        date +"%A, %B %e %Y %l:%M %P %Z" -d "$(echo "${@:2}")" | tr -d '\n' >~/nojack-date
        if [ -n "$(njhll)" ] ; then echo "(run lasted $(nojackdiff "$(njhll | cut -d' ' -f1-7)"))" | xargs bash -c 'echo "$(< ~/nojack-date)" "$@"' argv0 >> ~/nojack-history ; else echo "$(< ~/nojack-date)" >> ~/nojack-history ; fi
        chflags hidden ~/nojack-history ~/nojack-date
        echo "Date set to: $(suffixeddate) ($(nojackdiff now) ago)" ;
    elif [ "$1" == "-hist" ] && [ $# -eq 1 ]; then
        cat ~/nojack-history ;
    else
        echo $'Usage: nojack-tracker\n       nojack-tracker -set [date]\n       nojack-tracker -hist'
    fi
    unset -f ddifffmat njhll suffixeddate nojackdiff
}