diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-02-02 02:13:40 +0100 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-02-02 02:13:40 +0100 |
commit | e9752056b6eb824b85854e20dadac31c197cd235 (patch) | |
tree | f60f7ba21b8bdfcfadb7f504679a9b13daa343e0 /bin/guiscripts | |
parent | ca0cec60dacc4e8c6f8f37e0605b72bac54c9ea6 (diff) | |
parent | 541d9fa7014c5c197f7c8a09fa159ac84bd9a6a8 (diff) |
Merge branch 'main' of debuc.com:dotfiles
Diffstat (limited to 'bin/guiscripts')
-rwxr-xr-x | bin/guiscripts/sturl | 6 |
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 |