commit a18dff84414d9b666690aeae9ceac56780531d12 Author: Tyler Perkins Date: Fri Oct 22 11:00:53 2021 -0400 Inital commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..12e01d1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +#ignore all swp files +**/*.swp + +#ignore all executables, but still keep the bin folder +bin/* +!bin/.gitkeep diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..893c0cf --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ +############################################################################### +# Tyler Perkins +# 21-10-21 +# Makefile to install stackToDo +# + +#Install for one user +INSTALL_DIR="$${HOME}/.local/bin" +#Install system wide +#INSTALL_DIR="/usr/bin" + +install : + cp t* $(INSTALL_DIR)/ + +uninstall : + rm $(INSTALL_DIR)/tpeek + rm $(INSTALL_DIR)/tpop + rm $(INSTALL_DIR)/tpush diff --git a/README.md b/README.md new file mode 100644 index 0000000..13a9e2e --- /dev/null +++ b/README.md @@ -0,0 +1,27 @@ +stackToDo +========= + +A simple stack based to do program, for those that are easily side tracked +(like me). Due to the nature of a stack, it will track how you got side tracked +by pushing to it each time you move to a new task without completing it + +Install +------- + +``` +make install +``` + +Usage and specifics +------------------- + +A stack operates as a FILO container. When getting side tracked when performing +research, programming, etc, it can be hard to get back to the previous task. +Therefore, you can simply `push` a task onto the todo stack. Each task is a +127 character string of what was just happening. Be creative, it can be line +numbers of a file where you were working, the topic you were arguing in a +paper, anything. Once you finish a task, you can `pop` it off the todo stack +and get back to what you were previously doing. If you ever forget what you +were doing, simply `peek` at the top of the stack to see what you're doing +without removing it from the stack. Everything is kept in plaintext, so its +easy to parse with other programs. diff --git a/tpeek b/tpeek new file mode 100755 index 0000000..f8c12c7 --- /dev/null +++ b/tpeek @@ -0,0 +1,13 @@ +#!/bin/bash + +#zero arguments +if [ "$#" -ne 0 ]; then + echo "Usage:" $0 + echo "Returns what is at the top of the todo stack" +fi + +#make correct directories +mkdir -p ~/.config/stackToDo +touch ~/.config/stackToDo/todo + +tail -1 ~/.config/stackToDo/todo diff --git a/tpop b/tpop new file mode 100755 index 0000000..6e746b6 --- /dev/null +++ b/tpop @@ -0,0 +1,15 @@ +#!/bin/bash + +#must have no arguments +if [ "$#" -ne 0 ]; then + echo "Usage:" $0 + echo "Remove the last element of the stack and prints it" + exit 1 +fi + +#make correct directories +mkdir -p ~/.config/stackToDo +touch ~/.config/stackToDo/todo + +tail -1 ~/.config/stackToDo/todo +sed -i '$ d' ~/.config/stackToDo/todo diff --git a/tpush b/tpush new file mode 100755 index 0000000..dec280b --- /dev/null +++ b/tpush @@ -0,0 +1,21 @@ +#!/bin/bash + +#must have an argument +if [ "$#" -eq 0 ]; then + echo "Usage:" $0 "[STRING TO PUT ON STACK]" + echo "Pushes the given string to the top of the todo stack" + exit 1 +fi + +str="'$*'" + +if [ -z "$str" ]; then + echo "Must provide a non empty argument" + exit 1 +fi + +#make correct directories +mkdir -p ~/.config/stackToDo +touch ~/.config/stackToDo/todo + +echo $str >> ~/.config/stackToDo/todo