Skip to content

Commit 3600bcb

Browse files
author
Eric Guimarães de Sousa Silva
committed
Merge tag '0.1.1' into develop
Equalizing both branches (master and develop)
2 parents 7235530 + c7528f4 commit 3600bcb

File tree

1 file changed

+106
-41
lines changed

1 file changed

+106
-41
lines changed

gtd

Lines changed: 106 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,32 @@
1010

1111
# [System]
1212
gtdBannerString="Lowbit Inspector"
13-
gtdRefreshInterval=15
13+
gtdAreas="Business Career Family Finances Health Hobbies Love Social Spiritual Work"
14+
gtdContexts="home business work guarulhos"
15+
gtdRefreshInterval=30
1416
gtdTaskExec="task rc.verbose=nothing"
1517
gtdTerminatorString="done"
1618
# [Capture]
17-
gtdCaptureTerminatorString="done"
19+
#
1820
# [Clarify]
19-
gtdClarifyContexts="home business work"
20-
gtdClarifyCategories="Business Career Family Finances Health Hobbies Love Social Spiritual Work"
21-
gtdClarifySomedayListTerminator="done"
2221
gtdClarifyNothingString="Nothing to clarify. Be happy. =)"
2322
# [Organize]
23+
#
2424
# [Reflect]
25+
#
2526
# [Engage]
2627
gtdEngageTodayTitle="Today!"
2728
gtdEngageTodayAmount=5
2829
gtdEngageOverdueTitle="Overdue"
2930
gtdEngageOverdueAmount=3
3031
gtdEngageReadyTitle="Next Actions"
31-
gtdEngageReadyAmount=3
32+
gtdEngageReadyAmount=5
3233
gtdEngageWeekTitle="This Week"
33-
gtdEngageWeekAmount=2
34+
gtdEngageWeekAmount=3
3435
gtdEngageMonthTitle="This Month"
3536
gtdEngageMonthAmount=2
3637
gtdEngageYearTitle="This Year"
37-
gtdEngageYearAmount=2
38+
gtdEngageYearAmount=1
3839

3940
#_______________________Do_not_cross_this_line_(kidding)_______________________#
4041

@@ -48,15 +49,15 @@ function gtdBanner() {
4849

4950
clear
5051
echo "--------------------------------------------------------------------------------"
51-
echo " You are in ${gtdBannerString} | '${gtdMode}' mode"
52+
echo " You are in ${gtdBannerString} | ${gtdMode}"
5253
echo "--------------------------------------------------------------------------------"
5354
echo
5455
}
5556

5657
# Create the contexts used by the tool
5758
function gtdContextsCreate() {
5859

59-
for context in `echo ${gtdClarifyContexts}`; do
60+
for context in `echo ${gtdContexts}`; do
6061
${gtdTaskExec} context list | awk {'print $1'} | grep "${context}" > /dev/null
6162
gtdContextListRC=$?
6263

@@ -78,16 +79,16 @@ function gtdCapture() {
7879
${gtdTaskExec} context none 2> /dev/null
7980

8081
# Letting the user input its 'tasks' to the Inbox of Task Warrior
81-
echo "Type the things you need to capture (when you're done, type '${gtdCaptureTerminatorString}') "
82-
while [ "${usrCaptureString}" != "${gtdCaptureTerminatorString}" ]; do
82+
echo "Type the things you need to capture (when you're done, type '${gtdTerminatorString}') "
83+
while [ "${usrCaptureString}" != "${gtdTerminatorString}" ]; do
8384

8485
read -p "Capture: " usrCaptureString
8586

8687
case "${usrCaptureString}" in
8788
"")
88-
echo "Nothing? If you're done, type '${gtdCaptureTerminatorString}'"
89+
echo "Nothing? If you're done, type '${gtdTerminatorString}'"
8990
;;
90-
"${gtdCaptureTerminatorString}")
91+
"${gtdTerminatorString}")
9192
break
9293
;;
9394
*)
@@ -101,7 +102,10 @@ function gtdCapture() {
101102
# GTD Phase #2 - Clarify: Understanding the ideas previously captured
102103
function gtdClarify() {
103104

104-
gtdClarifyContextsAll="${gtdClarifyContexts} continue"
105+
# Cleaning the context before start
106+
${gtdTaskExec} context none 2> /dev/null
107+
108+
gtdClarifyContexts="${gtdContexts} continue"
105109

106110
while [ `${gtdTaskExec} status:pending project: wait: count` -gt 0 ]; do
107111

@@ -118,12 +122,12 @@ function gtdClarify() {
118122

119123
# Questions
120124
echo "Options:"
121-
select usrClarifyAction in "Action" "Someday" "Goal" "Habit" "Done" "Trash"; do
125+
select usrClarifyAction in "Action" "Someday" "Goal" "Habit" "Done" "Trash" "Quit"; do
122126
case "${usrClarifyAction}" in
123127
"Action")
124128

125-
echo "Which Category?"
126-
select usrClarifyCategory in ${gtdClarifyCategories}; do
129+
echo "Which Area?"
130+
select usrClarifyCategory in ${gtdAreas}; do
127131
task ${gtdClarifyNext} modify project:"${usrClarifyCategory}"
128132
break
129133
done
@@ -150,7 +154,7 @@ function gtdClarify() {
150154
esac
151155
done
152156

153-
echo "Do you need to rename it?"
157+
echo "What is the next Action? Do you need to rename it?"
154158
select usrClarifyRenameBool in "Yes" "No"; do
155159
case ${usrClarifyRenameBool} in
156160
"Yes")
@@ -169,7 +173,7 @@ function gtdClarify() {
169173
done
170174

171175
echo "Which are the contexts? (select once at a time, then select 'continue')"
172-
select usrClarifyContext in ${gtdClarifyContextsAll}; do
176+
select usrClarifyContext in ${gtdClarifyContexts}; do
173177
case "${usrClarifyContext}" in
174178
"continue")
175179
break
@@ -295,37 +299,51 @@ function gtdClarify() {
295299
break
296300

297301
;;
302+
298303
"Someday")
299304
task ${gtdClarifyNext} modify project:Someday
300305
task tags
301306

302307
unset usrClarifySomedayList
303308

304-
while [ "${usrClarifySomedayList}" != "${gtdClarifySomedayListTerminator}" ]; do
305-
echo "Which lists? (once at time - when you're done, type '${gtdClarifySomedayListTerminator}')"
309+
while [ "${usrClarifySomedayList}" != "${gtdTerminatorString}" ]; do
310+
echo "Which lists? (once at time - when you're done, type '${gtdTerminatorString}')"
306311
read -p "List: " usrClarifySomedayList
307-
if [ -n "${usrClarifySomedayList}" ]; then
308-
task ${gtdClarifyNext} modify +"${usrClarifySomedayList}"
309-
fi
312+
case "${usrClarifySomedayList}" in
313+
"${gtdTerminatorString}")
314+
break
315+
;;
316+
*)
317+
task ${gtdClarifyNext} modify +"${usrClarifySomedayList}"
318+
;;
319+
esac
310320
done
311321

312322
break
313323

314324
;;
325+
315326
"Goal")
316327
echo "Soon..."
317328
;;
329+
318330
"Habit")
319331
echo "Soon..."
320332
;;
333+
321334
"Done")
322335
task ${gtdClarifyNext} done
323336
break
324337
;;
338+
325339
"Trash")
326340
task ${gtdClarifyNext} delete
327341
break
328342
;;
343+
344+
"Quit")
345+
exit
346+
;;
329347
esac
330348
done
331349

@@ -342,27 +360,66 @@ function gtdClarify() {
342360
function gtdOrganize() {
343361
gtdBanner "Organize"
344362

345-
echo "What to Organize?"
346-
select usrOrganizeOption in "Contexts" "Projects" "Tags"; do
363+
echo "Organize your System:"
364+
select usrOrganizeOption in "Contexts" "Projects" "Lists" "Calendar" "Quit"; do
347365
case ${usrOrganizeOption} in
348366
"Contexts")
349-
${gtdTaskExec} context list
367+
echo
368+
echo "Your contexts are:"
369+
task context list
350370
;;
351371

352372
"Projects")
353373
unset usrOrganizeProject
354-
355-
${gtdTaskExec} projects; echo
356-
357-
echo "Type the name of a Project to organize it (when you're done, type '${gtdTerminatorString}') "
358-
while [ "${usrOrganizeProject}" != "${gtdTerminatorString}" ]; do
359-
read -p "Project: " usrOrganizeProject
374+
echo "Projects:"
375+
select usrOrganizeProjectsMode in "All" "Summary" "Back"; do
376+
case ${usrOrganizeProjectsMode} in
377+
378+
"All")
379+
task summary
380+
;;
381+
382+
"Summary")
383+
384+
echo
385+
echo "Projects by Area:"
386+
echo
387+
388+
for area in `echo $gtdAreas`; do
389+
areaOutput=`${gtdTaskExec} projects project:"${area}". | tail -n1`
390+
echo "${areaOutput}" | grep "No project" > /dev/null 2>&1
391+
areaOutputRC=$?
392+
if [ ${areaOutputRC} -ne 0 ]; then
393+
areaProjectsTotal=`echo "${areaOutput}" | cut -d' ' -f1`
394+
areaProjectsReal=`echo "${areaProjectsTotal}-1" | bc`
395+
echo "${area}: ${areaProjectsReal}"
396+
else
397+
echo "${area}: --"
398+
fi
399+
done
400+
;;
401+
402+
"Back")
403+
break
404+
;;
405+
406+
esac
360407
done
408+
361409
;;
362410

363-
"Tags")
411+
"Lists")
364412
${gtdTaskExec} tags
365413
;;
414+
415+
"Calendar")
416+
${gtdTaskExec} calendar
417+
;;
418+
419+
"Quit")
420+
break
421+
;;
422+
366423
esac
367424
done
368425

@@ -376,8 +433,16 @@ function gtdReflect() {
376433
# GTD Phase #5 - Engage: Getting Things Done
377434
function gtdEngage() {
378435

436+
gtdBanner "Engage - Context: ???"
437+
438+
echo "What are your current context?"
439+
select usrEngageContext in ${gtdContexts}; do
440+
${gtdTaskExec} context "${usrEngageContext}"
441+
break
442+
done
443+
379444
while [ true ]; do
380-
gtdBanner "Engage"
445+
gtdBanner "Engage - Context: ${usrEngageContext}"
381446
gtdQuery "${gtdEngageTodayTitle}" "next +TODAY" "${gtdEngageTodayAmount}"
382447
gtdQuery "${gtdEngageOverdueTitle}" "overdue" "${gtdEngageOverdueAmount}"
383448
gtdQuery "${gtdEngageReadyTitle}" "ready" "${gtdEngageReadyAmount}"
@@ -415,11 +480,11 @@ else
415480
echo " `basename $0` OPTION"
416481
echo
417482
echo "Options:"
418-
echo " capture"
419-
echo " clarify"
420-
echo " organize"
421-
echo " reflect"
422-
echo " engage"
483+
echo " capture - Collect ideas (everytime something pops up in your mind)"
484+
echo " clarify - Understand ideas (every 1 or 2 days)"
485+
echo " organize - Check your system (when you feel like things are messy)"
486+
echo " reflect - Update your system (once a week - review your lists)"
487+
echo " engage - Get Things Done! (everyday - the major portion of time)"
423488
exit 1
424489
fi
425490

0 commit comments

Comments
 (0)