summaryrefslogtreecommitdiffstats
path: root/loadutil
blob: 0e6a23d322fd0131482695faa257055dc9d70619 (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
47
48
#!/bin/zsh

type=${1:="sess"}


if [[ $type == sess ]];then
    export yprofile="dactyl-sess"
    pushd ~/.dactyls/sessions
    file=$(print -l *(om[1,-1]) | ${=DMENU})
    [[ -z $file ]] && exit
        if [[ -n $file && $file == *: ]];then
            while :;do
                url=$($=DMENU < $file)
                [[ -z $url ]] && break
                firefox -new-tab $url[(w)1]
            done
        else
            for line in "${(f)$(<$file)}";do
                firefox -new-tab $line[(w)1]
            done
        fi
    popd
elif [[ $type == ist ]];then
    export yprofile="dactyl-hist"
    pushd ~/.dactyls/history/
    #url=$(tac history | grep -v "about:blank" |  uniq |  ${(e)=YDMENU})
    url=$(tac history | grep -v "about:" |  uniq |  $=DMENU)
    [[ -n $url ]] && firefox -new-tab $url[(w)1]
    popd
elif [[ $type == speed ]];then
    export yprofile="speed"
    while :;do

        url=$(awk '{ print NR" "$0 }' ~/.dactyls/speedy/speed | ${(e)=YDMENU} | awk '{ print $2 }')
        [[ -z $url ]] && exit
        firefox -new-tab "$url"

    done
elif [[ $type == lark ]];then
    export yprofile="dactyl-lark"
    while :;do

        url=$(awk '{ print NR" "$0 }' ~/.dactyls/bmark/larks | ${(e)=YDMENU} | awk '{ print $2 }')
        [[ -z $url ]] && exit
        firefox -new-tab  "$url"

    done
fi