summaryrefslogtreecommitdiffstats
path: root/loadutil
diff options
context:
space:
mode:
authorRaghavendra D Prabhu <raghu.prabhu13@gmail.com>2011-03-13 00:24:47 +0530
committerRaghavendra D Prabhu <raghu.prabhu13@gmail.com>2011-03-13 00:24:47 +0530
commit5ec75ea891c9b44cdd2d7a3e0c29b4d08dff2b2a (patch)
treedeabb15393558ab3a1a629fc0782d8b0c3124c48 /loadutil
downloadScripts-5ec75ea891c9b44cdd2d7a3e0c29b4d08dff2b2a.tar.gz
Scripts-5ec75ea891c9b44cdd2d7a3e0c29b4d08dff2b2a.tar.bz2
Scripts-5ec75ea891c9b44cdd2d7a3e0c29b4d08dff2b2a.zip
Initial scripts update
Diffstat (limited to 'loadutil')
-rwxr-xr-xloadutil48
1 files changed, 48 insertions, 0 deletions
diff --git a/loadutil b/loadutil
new file mode 100755
index 0000000..0e6a23d
--- /dev/null
+++ b/loadutil
@@ -0,0 +1,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