diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-12-12 09:22:22 +0100 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-12-12 09:22:22 +0100 |
commit | ffc2a7d3cee6385508601374bdd34db253b70c65 (patch) | |
tree | 433bda0daa8504538ce27bdc7a80999bba611663 /bin/guiscripts/sturl | |
parent | f4dc6e9489bd1274cba77aec04343dbec72f4a7d (diff) | |
parent | 6b44e39caba17672bf32960f5829597d9fa544b1 (diff) |
Merge branch 'main' of debuc.com:dotfiles
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 c738c8e..5b8b1e7 100755 --- a/bin/guiscripts/sturl +++ b/bin/guiscripts/sturl @@ -1,11 +1,11 @@ #!/bin/sh -regex='(((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" | dmenu -x -c -g 1 -l 10)" +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)" [ -z "$url" ] && exit 1 case $1 in - 'c') echo -n "$url" | xclip -sel c -r ;; + 'c') printf '%s' "$url" | xclip -sel c -r ;; 'o') linkhandler "$url" ;; *) echo "no option" ;; esac |