dotfiles

custom linux config files managed with gnu stow

dotfiles

bin/bin/todo


#!/bin/bash
#
# simple todo script
# 
#  ▓▓▓▓▓▓▓▓▓▓
# ░▓ author ▓ xero <x@xero.nu>
# ░▓ code   ▓ http://code.xero.nu/todo
# ░▓ mirror ▓ http://pub.iotek.org/p/mJPHqv8
# ░▓▓▓▓▓▓▓▓▓▓
# ░░░░░░░░░░

file="~/.todo"
( [ -e "$file" ] || touch "$file" ) && [ ! -w "$file" ] && echo cannot write to $file && exit 1
if [[ -z  ||  == "--help" ||  == "-h" ||  == "help" ]]; then
	echo "┌──────[ todo ]──[ version 0.0.1 ]─────── ─ ─"
	echo "│ usage: todo <options>"
	echo "│ author: xero harrison - http://xero.nu"
	echo "├────────────────[ options ]"───────────── ─ ─
	echo "│ -s, --show            display the todo list"
	echo "│ -a, --add <string>    add a todo item"
	echo "│ -d, --delete <number> delete a todo item"
	echo "│ -h, --help            display this screen"
	echo "└──────────────────────────────────────── ─ ─"
elif [[  = '--show' ||  = '-s' ||  == "show" ]]; then
	while true;
	do
		clear
		echo ""
		echo "     ██                 ██"
		echo "    ░██                ░██"
		echo "   ██████  ██████   ██████  ██████"
		echo "  ░░░██  ░██░░░░██░██░░░██░██   ░██"
		echo "    ░██  ░██   ░██░██  ░██░██   ░██"
		echo "    ░░██ ░░██████ ░░██████░░██████"
		echo "     ░░   ░░░░░░   ░░░░░░  ░░░░░░"
		echo ""
		echo "     _ __ __________________ __ _"
		echo ""
		nl -b a $file
		sleep 4
	done;
elif [[  = '--delete' ||  = '-d' ||  == "delete" ]]; then
	if [[ -z  ]]; then
		echo "missing option"
		echo "pass an item number to delete"
	else
		sed -e 'd' -i $file
	fi
elif [[  = '--add' ||  = '-a' ||  == "add" ]]; then
        if [[ -z  ]]; then
		echo "missing option"
		echo "pass an item to add"
	else
		echo  >> $file
	fi 
else
	echo "unknown option"
	echo "call 'todo --help' for more info"
fi
exit

Download

raw zip tar