aboutsummaryrefslogtreecommitdiff
path: root/jtx.sh
diff options
context:
space:
mode:
authorLibravatar Stepanov Aleksey <blueingreen@bluig.xyz>2025-05-11 14:12:21 +0500
committerLibravatar Stepanov Aleksey <blueingreen@bluig.xyz>2025-05-11 14:12:21 +0500
commitb26818dad13db472b20e299d96d0fb124417a5e6 (patch)
treecaf27ea27c321cbe4a8ce0be25c4cc37d3933dfd /jtx.sh
add taskwarrior-tui-scripts project
Diffstat (limited to 'jtx.sh')
-rwxr-xr-xjtx.sh46
1 files changed, 46 insertions, 0 deletions
diff --git a/jtx.sh b/jtx.sh
new file mode 100755
index 0000000..1dcc19b
--- /dev/null
+++ b/jtx.sh
@@ -0,0 +1,46 @@
+#!/usr/bin/env bash
+
+#****F* ./jtx.sh
+# NAME
+#
+# jtx.sh - bash-скрипт для работы с мобильным приложением jtxBoard.
+#******
+
+source "$HOME/bin/taskwarrior-tui-scripts/lib/global.sh"
+
+taskArr=($@)
+
+declare parentTaskUid
+declare childIcsFile
+
+hasProject "$taskArr"
+
+for taskIndex in "${!taskArr[@]}"; do
+ todo new "$(task _get "${taskArr[$taskIndex]}".description)"
+
+ parentTaskUid=$(ls "$MY_CAL" -tr --time="birth" | tail -n 1 | sed 's/\(.*\)\.ics/\1/')
+
+ annotationNum=1
+ while true; do
+
+ declare task
+
+ task=$(task _get "${taskArr[$taskIndex]}".annotations."$annotationNum".description)
+
+ if [[ "$task" = "" ]]; then
+ break
+ else
+ todo new "$task"
+
+ childIcsFile=$(ls "$MY_CAL" -tr --time="birth" | tail -n 1)
+ sed -i "/END:VTODO/i RELATED-TO;RELTYPE=PARENT:$parentTaskUid" "$MY_CAL/$childIcsFile"
+
+ ((annotationNum++))
+ fi
+
+ done
+
+ task rc.bulk=0 rc.confirmation=off delete "${taskArr[$taskIndex]}"
+done
+
+vdirsyncer sync