dotfiles/system/.local/bin/todo
Severin Kaderli 348ece6f11
Change email in all files
Signed-off-by: Severin Kaderli <severin@kaderli.dev>
2019-03-07 17:27:17 +01:00

33 lines
952 B
Bash
Executable file

#!/usr/bin/env bash
#
# SCRIPT NAME:
# todo
#
# AUTHOR:
# Severin Kaderli <severin@kaderli.dev>
#
# DESCRIPTION:
# Lists the TODOs.
#
# USAGE:
# ./todo
clear
while read -r line
do
task=$(echo "${line}" | cut -d "," -f 6)
project=$(echo "${line}" | cut -d "," -f 4 | sed -e "s/^#//")
datetime=$(echo "${line}" | cut -d "," -f 3)
echo -e "[${datetime}][${project}]\n☐ ${task}\n"
done <<< "$(todoist s && todoist --csv list --filter "(overdue | today)")"
TODOS=$(rg -g "!todo" --hidden --no-heading -n "TODO:" "${HOME}/dotfiles" "${HOME}/Projects")
if [ -n "${TODOS}" ]; then
while read -r line; do
file=$(echo "${line}" | cut -d ":" -f 1 | sed -e "s/^[[:space:]]*//")
lineNumber=$(echo "${line}" | cut -d ":" -f 2 | sed -e "s/^[[:space:]]*//")
task=$(echo "${line}" | cut -d ":" -f 4 | sed -e "s/^[[:space:]]*//")
echo -e "[Line ${lineNumber}][${file}]\n☐ ${task}\n"
done <<< "${TODOS}"
fi