#!/bin/bash
#                       /usr/local/bin/todo
# https://crystalfaeries.net/posix/bin/todo
# celeste:crystalfaery TODO 2020-04-07 01:08:49+00:00

# TODO list is comprised of:
#
#  ~/crystalfaeries.net/src/.??*	blog articles	in development and TODO items	(newest first)
# /usr/local/bin/.??*	scripts				in development and TODO items	(newest first)
#
# /usr/local/bin/*	scripts				already active			(oldest first)
#  ~/crystalfaeries.net/src/*	blog articles	already active			(oldest first)
#  ~/crystalfaeries.net/imgs/{,*/}HEADER.html	image HEADER files		(oldest first)

# NOTE: cronjob runs at end of each month:
# 00	14	28	02	*	/usr/local/bin/chrontouch
# 00	14	30     9,4,6,11	*	/usr/local/bin/chrontouch
# 00	14	31     1,3,5,7	*	/usr/local/bin/chrontouch
# 00	14	31     8,10,12	*	/usr/local/bin/chrontouch
# so that user will find largest TODO files as most recent TODO files
#            and it also finally prioritizes the scripting TODOs

# start with the newest TODO items:
ls -t	$HOME/crystalfaeries.net/src/.??*			\
	$HOME/crystalfaeries.net/posix/bin/.??*			>  /tmp/.$$.txt
# then the oldest articles and scripts and documents:
ls -tr	$HOME/crystalfaeries.net/src/*				\
	$HOME/crystalfaeries.net/posix/bin/*			\
	$HOME/crystalfaeries.net/posix/doc/txt/*		>> /tmp/.$$.txt
# then the oldest directory pages:
ls -tr	$HOME/crystalfaeries.net/imgs/index.html		\
	$HOME/crystalfaeries.net/imgs/*/HEADER.html		>> /tmp/.$$.txt
# then the oldest documents:
ls -tr	$HOME/documents/txt/*					>> /tmp/.$$.txt
# excluding any deleted (size 0) files:
cp /dev/null							   /tmp/.$$.edit.txt
for f in `cat /tmp/.$$.txt`
do
	if [ -s "${f}" ]
	then
		echo "${f}"					>> /tmp/.$$.edit.txt
	fi
done
rm								   /tmp/.$$.txt
vi								`cat /tmp/.$$.edit.txt`
rm								 cat /tmp/.$$.edit.txt
exit $?
