diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-01-25 21:57:49 +0100 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-01-25 21:57:49 +0100 |
commit | 3f7b5dd79688fa4d36302a60175ed3bb53e225d8 (patch) | |
tree | a0aa38c075261f54a520e0c819d6251af3578381 /bin/guiscripts/sturl | |
parent | 5f06a3ca53faf20a75ae672b89ba201ff7cf3877 (diff) |
Use clipp and remove tac
Diffstat (limited to 'bin/guiscripts/sturl')
-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 |