iT邦幫忙

2

把事情完成的待辦事項:todotxt

  • 分享至 

  • xImage
  •  

完成待辦事項,是生活中常要面對的,常在Linux的環境中,就在此隨時用todo的清單來管理待辦事項。
GTD 的實踐

GTD是英文Getting Things Done的縮寫,是一種行為管理的方法,也是David Allen寫的一本書的書名。
GTD的主要原則在於一個人需要通過記錄的方式把頭腦中的各種任務移出來。通過這樣的方式,頭腦可以不用塞滿各種需要完成的事情,而集中精力在正在完成的事情。

把要做的事情一條一條列出,完成一件就畫掉一件,看似很簡單的原則,此時就需要有待辦事項的列表,其中 Todo.txt,就是把想要做的事情,就先寫下來的軟體,開發有Apple及Android的APP,同時又有windows桌面上的todotxt.net的軟體;還有其他不同桌面環境或者web界面的todo開發實作,也包括了這個 Todo.txt CLI 命令列的版本。

而這版本的所有檔案是這個樣子:

todotxt /usr/
todotxt /usr/bin/
todotxt /usr/bin/todo.sh
todotxt /usr/share/
todotxt /usr/share/bash-completion/
todotxt /usr/share/bash-completion/completions/
todotxt /usr/share/bash-completion/completions/todo.sh
todotxt /usr/share/todotxt/
todotxt /usr/share/todotxt/todo.cfg

簡單地說,這個應用程式是個shell script。

設定簡介
在 Linux 上安裝好 todotxt 後,首先複製程式裡的 todo.cfg 到家目錄:

cp /usr/share/todotxt/todo.cfg ~/.todo.cfg

再編輯 ~/.todo.cfg 裡的這一行:

export TODO_DIR=`dirname "$0"`
#修改為指定把todo產生的檔案放置處:
export TODO_DIR="/home/singernew/TODO"

第一次執行 todo.sh 後出現:

$ todo.sh
Usage: todo.sh [-fhpantvV] [-d todo_config] action [task_number] [task_description]
Try 'todo.sh -h' for more information.

然後執行 todo.sh -h 可看到操作的指令說明:

  Usage: todo.sh [-fhpantvV] [-d todo_config] action [task_number] [task_description]

  Actions:
    add|a "THING I NEED TO DO +project @context"
    addm "THINGS I NEED TO DO
          MORE THINGS I NEED TO DO"
    addto DEST "TEXT TO ADD"
    append|app ITEM# "TEXT TO APPEND"
    archive
    command [ACTIONS]
    deduplicate
    del|rm ITEM# [TERM]
    depri|dp ITEM#[, ITEM#, ITEM#, ...]
    do ITEM#[, ITEM#, ITEM#, ...]
    help
    list|ls [TERM...]
    listall|lsa [TERM...]
    listaddons
    listcon|lsc
    listfile|lf [SRC [TERM...]]
    listpri|lsp [PRIORITIES] [TERM...]
    listproj|lsprj [TERM...]
    move|mv ITEM# DEST [SRC]
    prepend|prep ITEM# "TEXT TO PREPEND"
    pri|p ITEM# PRIORITY
    replace ITEM# "UPDATED TODO"
    report
    shorthelp

  Actions can be added and overridden using scripts in the actions
  directory.

  See "help" for more details.

這時
$ ls -l TODO/
total 0
-rw-r--r-- 1 singernew users 0 Sep 29 20:39 done.txt
-rw-r--r-- 1 singernew users 0 Sep 29 20:39 report.txt
-rw-r--r-- 1 singernew users 0 Sep 29 20:39 todo.txt

產生了 todo 所會存取的相關檔案。

使用簡介
列出工作、新增工作

$ todo.sh ls
--
TODO: 0 of 0 tasks shown
[singernew@ithelp ~]$ todo.sh a 寫第14篇鐵人文章
1 寫第14篇鐵人文章
TODO: 1 added.
[singernew@ithelp ~]$ todo.sh a 寫第15篇鐵人文章
2 寫第15篇鐵人文章
TODO: 2 added.
[singernew@ithelp ~]$ todo.sh a 寫第17篇鐵人文章
3 寫第17篇鐵人文章
TODO: 3 added.
[singernew@ithelp ~]$ todo.sh ls
1 寫第14篇鐵人文章
2 寫第15篇鐵人文章
3 寫第17篇鐵人文章
--
TODO: 3 of 3 tasks shown

修改及完成項目、設定優先權

$ todo.sh app 2 再加第16篇
2 寫第15篇鐵人文章 再加第16篇
[singernew@ithelp ~]$ todo.sh ls
1 寫第14篇鐵人文章
2 寫第15篇鐵人文章 再加第16篇
3 寫第17篇鐵人文章
--
TODO: 3 of 3 tasks shown
# 設定優先權,用 A-Z 來額外設定優先的程度。
$ todo.sh pri 3 a
3 (A) 寫第17篇鐵人文章
TODO: 3 prioritized (A).
$ todo.sh ls
3 (A) 寫第17篇鐵人文章
1 寫第14篇鐵人文章
2 寫第15篇鐵人文章 再加第16篇
--
TODO: 3 of 3 tasks shown
# 指定某完成工作後,會被標示已完成 ls 看不到已完成的項目。
$ todo.sh do 1
1 x 2013-09-29 寫第14篇鐵人文章
TODO: 1 marked as done.
x 2013-09-29 寫第14篇鐵人文章
TODO: /home/singernew/TODO/todo.txt archived.
$ todo.sh ls
2 (A) 寫第17篇鐵人文章
1 寫第15篇鐵人文章 再加第16篇
--
TODO: 2 of 2 tasks shown
# listall 會把已完成的項目也顯示出來。
$ todo.sh listall
2 (A) 寫第17篇鐵人文章
0 x 2013-09-29 寫第14篇鐵人文章
1 寫第15篇鐵人文章 再加第16篇
--
TODO: 2 of 2 tasks shown
DONE: 1 of 1 tasks shown
total 3 of 3 tasks shown

簡單應用
在 ~/.bashrc 裡加入
todo.sh ls
這一行,每次登入就會列出未完成事項。


圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言