From 1c554f6862449baf859a1fee2fc3fcfa58813ed7 Mon Sep 17 00:00:00 2001 From: Alexis Hovorka Date: Tue, 10 Nov 2020 23:21:19 -0700 Subject: [feat] Add taskwarrior configuration --- base/task/taskwarrior-holidays.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 base/task/taskwarrior-holidays.sh (limited to 'base/task/taskwarrior-holidays.sh') diff --git a/base/task/taskwarrior-holidays.sh b/base/task/taskwarrior-holidays.sh new file mode 100755 index 0000000..97ddb4a --- /dev/null +++ b/base/task/taskwarrior-holidays.sh @@ -0,0 +1,17 @@ +#/bin/bash + +YEARNOW="$(date +%Y)" +YEARNEXT="$(date -d "next year" +%Y)" + +(echo "["; +curl -s https://holidata.net/en-US/$YEARNOW.json | sed "s/$/,/g"; +curl -s https://holidata.net/en-US/$YEARNEXT.json | sed "s/$/,/g" | head -c-2; +echo "]") | jq -r 'map(select(.region == "")) | to_entries | + map((.key+1 | tostring) + "\t" + .value.description + "\t" + .value.date) | .[]' | +while read e; do + INDX="$(echo "$e" | cut -f1)" + NAME="$(echo "$e" | cut -f2)" + DATE="$(echo "$e" | cut -f3 | tr -d "-")" + echo "holiday.en-US$INDX.name=$NAME" + echo "holiday.en-US$INDX.date=$DATE" +done -- cgit v1.2.3-70-g09d2