commit f27a7ba8a9917350b9e8e030dbe9b0ddc7853efc
parent dc98ca849be58202d929be76975bc8d4f2592a61
Author: hhvn <dev@haydenvh.com>
Date: Tue, 2 Mar 2021 13:02:22 +0000
.scripts/bin/urlhand: don't prompt for selection of single URI
Diffstat:
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/.scripts/bin/urlhand b/.scripts/bin/urlhand
@@ -1,6 +1,9 @@
#!/bin/sh
-link=$(grep -Eo '[A-Za-z][A-Za-z]*://[^ ]*' < /dev/stdin 2>/dev/null | sed 's/[>,:)]$//' | dmenu -i)
+links=$(grep -Eo '[A-Za-z][A-Za-z]*://[^ ]*' < /dev/stdin 2>/dev/null | sed 's/[>,:)]$//')
+
+[ $(echo "$links" | wc -l) -eq 1 ] && link=$links || link=$(echo "$links" | dmenu -i)
+
[ "$link" = "" ] && exit 1
hand=$(printf "mpvms video
@@ -12,9 +15,10 @@ youtube-dl --add-metadata -xic
$(xprop -id $(cat /tmp/tabbed.xid) >/dev/null && echo "surf -e $(cat /tmp/tabbed.xid)" || echo ">/tmp/tabbed.xid tabbed -cr2 surf -e ''")
toxclip
netimg
-netvid
+netpdf
popupcurl
popupcgo
+popupw3m
torsocks mpvms video
torsocks mpvms
torsocks mpv --pause
@@ -23,7 +27,9 @@ torsocks youtube-dl --add-metadata -ic
torsocks youtube-dl --add-metadata -xic
torsocks $(xprop -id $(cat /tmp/tabbed.xid) >/dev/null && echo "surf -e $(cat /tmp/tabbed.xid)" || echo ">/tmp/tabbed.xid tabbed -cr2 surf -e ''")
torsocks netimg
+torsocks netpdf
torsocks popupcurl
-torsocks popupcgo" | dmenu -i)
+torsocks popupcgo
+torsocks popupw3m" | dmenu -i)
sh -c "$hand $link"