summaryrefslogtreecommitdiffstats
path: root/tmux-url
diff options
context:
space:
mode:
authorRaghavendra D Prabhu <rprabhu@wnohang.net>2011-07-16 23:11:17 +0530
committerRaghavendra D Prabhu <rprabhu@wnohang.net>2011-07-16 23:11:17 +0530
commit56d848c248199f02521e293f0568dbeac5185097 (patch)
tree430b777dfe67dc31647f0d1cf186a98017a49278 /tmux-url
parent806e6210978606d89e3af70eb10d90351b3ea488 (diff)
downloadScripts-56d848c248199f02521e293f0568dbeac5185097.tar.gz
Scripts-56d848c248199f02521e293f0568dbeac5185097.tar.bz2
Scripts-56d848c248199f02521e293f0568dbeac5185097.zip
Scripts update
Diffstat (limited to 'tmux-url')
-rwxr-xr-xtmux-url8
1 files changed, 4 insertions, 4 deletions
diff --git a/tmux-url b/tmux-url
index c2bcbab..ed0887b 100755
--- a/tmux-url
+++ b/tmux-url
@@ -8,21 +8,21 @@ tmux save-buffer /tmp/mux-buffer
typeset -A dispatcher
dispatcher=(
';' '/bin/true'
-':' 'ubrowser'
+':' '/bin/true'
)
while :;do
- LAST_URL=${$(/bin/grep -i -E 'http[s]?:.*' /tmp/mux-buffer | tac | $=DMENU ):?Empty input}
+ LAST_URL=${$(/bin/grep -i -E 'http[s]?:.*' /tmp/mux-buffer | tac | gawk 'BEGIN { RS="http[s]?:[[:graph:]]+"; } { print $1,RT }' | $=DMENU ):?Empty input}
echo "$LAST_URL" >>| ~/.current
method=$dispatcher[$LAST_URL[-1]]
if [[ -n $method ]];then
LAST_URL=$(perl -MRegexp::Common=URI -lne 'm{$RE{URI}{HTTP}{-scheme => qr/https?/}{-keep}} && print $1' <<< ${LAST_URL[1,-2]})
- $method $LAST_URL
+ $method $LAST_URL &
break
else
LAST_URL=$(perl -MRegexp::Common=URI -lne 'm{$RE{URI}{HTTP}{-scheme => qr/https?/}{-keep}} && print $1' <<< ${LAST_URL})
- browser $LAST_URL
+ browser $LAST_URL &
fi
done
xclip -i <<< $LAST_URL