summaryrefslogtreecommitdiff
path: root/.zsh_functions_taskwarrior
blob: 0a9bba736c1724124e403c743b2be3e8293ac956 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
in () {
    if [ $# -eq 0 ]; then
        task in
    else
        task add +in $@
    fi
}

tickle () {
    deadline=$1
    shift
    in +tickle wait:$deadline $@
}

think () {
    tickle +1d $@
}

rnd () {
    task add +rnd +in $@
}

webpage_title (){
    wget -qO- "$*" | hxselect -s '\n' -c  'title' 2>/dev/null
}

read_and_review (){
    local link="$1"
    local title=$(webpage_title $link)
    echo $title
    local descr="\"Read and review: $title\""
    local id=$(task add +in +read "$descr" | sed -n 's/Created task \(.*\)./\1/p')
    task "$id" annotate "$link"
}

rnr () {
    read_and_review $@
}

watch_and_review (){
    task add +in +watch $@
}

wnr () {
    watch_and_review $@
}