6 files changed,
1 insertions(+),
91 deletions(-)
Author:
Oleksandr Smirnov
olexsmir@gmail.com
Committed at:
2026-03-27 11:31:49 +0200
Parent:
30fafc4
D
config/todo/actions/@
··· 1 -#!/usr/bin/env bash 2 -export TODOTXT_VERBOSE=0 3 - 4 -action=$1 5 -shift 6 - 7 -if [[ $action == "usage" ]]; then 8 - echo "@ [context]" 9 - echo " Lists all tasks with the given context." 10 - echo " If no context is given, lists all tasks categorized by their context." 11 - echo " If task has @someday, it won't be listed." 12 - exit 0 13 -fi 14 - 15 -CONTEXTS=$(grep -o '[^ ]*@[^ ]\+' "$TODO_FILE" | grep '^@' | sort -u | sed 's/^@//g' ) 16 -for context in $CONTEXTS ; do 17 - if [[ $context == "someday" ]]; then 18 - continue 19 - fi 20 - 21 - CONTEXT_LIST=$(_list "$TODO_FILE" "@$context\b" "$@" | sed 's/\ *@[a-zA-Z0-9._\-]*\ */ /g') 22 - if [[ -n "${CONTEXT_LIST}" ]]; then 23 - echo -e "--@${context}" 24 - echo "${CONTEXT_LIST}" | eval "$TODOTXT_FINAL_FILTER" 25 - fi 26 -done
D
config/todo/actions/url
··· 1 -#!/usr/bin/env bash 2 -action=$1 3 -shift 4 - 5 -if [[ $action == "usage" ]]; then 6 - echo "url [task_number] - opens link in the task" 7 - exit 0 8 -fi 9 - 10 -item=$1 11 -if [[ $item == "" ]]; then 12 - TODOTXT_VERBOSE=0 $TODO_FULL_SH ls @url 13 - exit 0 14 -fi 15 - 16 -if [[ ! "$item" =~ ^[0-9]+$ ]]; then 17 - echo "provided [task_number] is invalid: $item" 18 - exit 1 19 -fi 20 - 21 -URL_REGEX="\b(?:https?:\/\/)?(?:[\w-]+\.)+[a-z]{2,}(?:\/[\w\-./?%&=:#@+]*)?" 22 -URL=$(sed "$item!d" "$TODO_FILE" | grep -Po "$URL_REGEX") 23 - 24 -if [[ -z "$URL" ]]; then 25 - echo "No URL found in task $item" 26 - exit 1 27 -fi 28 - 29 -if [[ ! "$URL" =~ ^(?!https?:\/\/) ]]; then 30 - URL="https://$URL" 31 -fi 32 - 33 -echo "$URL" 34 -xdg-open "$URL" &>/dev/null
D
config/todo/config
··· 1 -# vim: ft=bash 2 -# reference: /etc/todo/config 3 -export TODOTXT_VERBOSE=1 4 - 5 -export TODO_ACTIONS_DIR="$HOME/.dotfiles/config/todo/actions" 6 -export TODOTXT_DEFAULT_ACTION="next" 7 - 8 -export TODO_DIR=~/org 9 -export TODO_FILE="$TODO_DIR/todo.txt" 10 -export DONE_FILE="$TODO_DIR/done.txt" 11 -export REPORT_FILE="$TODO_DIR/.report.txt" 12 -export HABIT_FILE="$TODO_DIR/habits.txt" 13 - 14 -export PRI_A=$YELLOW 15 -export PRI_B=$PURPLE 16 -export PRI_C=$LIGHT_BLUE 17 - 18 -export COLOR_PROJECT=$GREEN 19 -export COLOR_CONTEXT=$CYAN 20 -export COLOR_DATE=$BLUE 21 -export COLOR_NUMBER=$CYAN 22 -export COLOR_META=$BLUE