summaryrefslogtreecommitdiff
path: root/bin/guiscripts/sturl
diff options
context:
space:
mode:
Diffstat (limited to 'bin/guiscripts/sturl')
-rwxr-xr-xbin/guiscripts/sturl6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/guiscripts/sturl b/bin/guiscripts/sturl
index 5b8b1e7..d261e32 100755
--- a/bin/guiscripts/sturl
+++ b/bin/guiscripts/sturl
@@ -1,11 +1,11 @@
#!/bin/sh
-regex='(((file|https?|gopher|gemini|ftps?|git)://|www\.)[a-zA-Z0-9.]*[:;a-zA-Z0-9./+@$&%?$\#=_~-]*)|(magnet:\?xt=urn:btih:[a-zA-Z0-9]*)'
-url="$(tr -d '\n' | grep -Eo "$regex" | tac | commander -cl)"
+regex='(((file|https?|gopher|gemini|ftps?|git)://|www\.)[a-zA-Z0-9.]*[:;!a-zA-Z0-9./+@$&%?$\#=_~-]*)|(magnet:\?xt=urn:btih:[a-zA-Z0-9]*)'
+url="$(tr -d '\n' | grep -Eo "$regex" | commander -cl)"
[ -z "$url" ] && exit 1
case $1 in
- 'c') printf '%s' "$url" | xclip -sel c -r ;;
+ 'c') printf '%s' "$url" | clipp ;;
'o') linkhandler "$url" ;;
*) echo "no option" ;;
esac