diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-03-06 09:40:11 +0100 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-03-06 09:40:11 +0100 |
commit | dd0c8a7f17010c3966cab08eab0b7fb0bfeda24e (patch) | |
tree | 249c74147493e85d5eefa59ed0989f51cd309bfc /bin/guiscripts/sturl | |
parent | b45ca4e7202f1cfb68fd22be6a8904e477e975c6 (diff) | |
parent | 368c78fdd6b9bfdc297bbbb5368d838d52ab0787 (diff) |
Merge remote-tracking branch 'refs/remotes/origin/main'
Diffstat (limited to 'bin/guiscripts/sturl')
-rwxr-xr-x | bin/guiscripts/sturl | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/bin/guiscripts/sturl b/bin/guiscripts/sturl index f7a3956..bf1fb02 100755 --- a/bin/guiscripts/sturl +++ b/bin/guiscripts/sturl @@ -1,4 +1,11 @@ #!/bin/sh -regex='\(ipfs:\|ipns:\|magnet:\|mailto:\|gemini:\|gopher:\|https:\|http:\|news:\|file:\|git:\|ssh:\|ftp:\)[^\<>"{-}\^`]\+' -url="$(grep "$regex" | sort | uniq | dmenu -g 1 -l 10 -x -c)" -linkhandler $url + +regex='(((https?|gopher|gemini|ftps?|git)://|www\.)[a-zA-Z0-9.]*[:;a-zA-Z0-9./+@$&%?$\#=_~-]*)|(magnet:\?xt=urn:btih:[a-zA-Z0-9]*)' +url="$(cat | tr -d '\n' | grep -Eo "$regex" | dmenu -x -c -g 1 -l 10)" +[ -z "$url" ] && exit 1 + +case $1 in + 'c') echo -n "$url" | xclip -sel c -r ;; + 'o') linkhandler "$url" ;; + *) echo "no option" ;; +esac |